fan_easy
FanEasy एक सरल Flutter पैकेज है जो आसानी से Facebook Audience Network विज्ञापनों के समारोह के साथ एकीकरण करता है और उपयोग में आसान तरीके प्रदान करता है।
FanEasy एक सरल Flutter पैकेज है जो आसानी से Facebook Audience Network विज्ञापनों के समारोह के साथ एकीकरण करता है और उपयोग में आसान तरीके प्रदान करता है।
{"sdk":"flutter"}^0.0.7{"sdk":"flutter"}^5.0.0यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
FanEasy is a simple and efficient Flutter package for integrating Facebook Audience Network ads seamlessly. It provides easy-to-use methods for loading and displaying various ad formats.
Add this to your pubspec.yaml file:
dependencies:
fan_easy: any
Then run:
flutter pub get
Before using any ad feature, initialize the SDK:
import 'package:fan_easy/fan_easy.dart';
void main() {
FanEasy.instance.loadInit(testingId: "YOUR_TESTING_ID");
}
FanEasy.instance.loadInterstitial(placementId: "YOUR_INTERSTITIAL_PLACEMENT_ID");
if (FanEasy.instance.interstitialLoaded) {
FanEasy.instance.showInterstitial();
}
FanEasy.instance.loadRewarded(placementId: "YOUR_REWARDED_PLACEMENT_ID");
if (FanEasy.instance.rewardedLoaded) {
FanEasy.instance.showRewarded();
}
FanEasy.instance.bannerAd(placementId: "YOUR_BANNER_PLACEMENT_ID")
FanEasy.instance.nativeAd(placementId: "YOUR_NATIVE_PLACEMENT_ID")
import 'package:flutter/material.dart';
import 'package:fan_easy/fan_easy.dart';
void main() {
runApp(MyApp());
FanEasy.instance.loadInit(testingId: "YOUR_TESTING_ID");
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text("FanEasy Example")),
body: AdExamplePage(),
),
);
}
}
class AdExamplePage extends StatefulWidget {
@override
_AdExamplePageState createState() => _AdExamplePageState();
}
class _AdExamplePageState extends State<AdExamplePage> {
@override
void initState() {
super.initState();
FanEasy.instance.loadInterstitial(placementId: "YOUR_INTERSTITIAL_PLACEMENT_ID");
FanEasy.instance.loadRewarded(placementId: "YOUR_REWARDED_PLACEMENT_ID");
}
@override
Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () => FanEasy.instance.showInterstitial(),
child: Text("Show Interstitial Ad"),
),
ElevatedButton(
onPressed: () => FanEasy.instance.showRewarded(),
child: Text("Show Rewarded Ad"),
),
SizedBox(height: 20),
FanEasy.instance.bannerAd(placementId: "YOUR_BANNER_PLACEMENT_ID"),
SizedBox(height: 20),
FanEasy.instance.nativeAd(placementId: "YOUR_NATIVE_PLACEMENT_ID"),
],
),
);
}
}
This package is licensed under the MIT License.