topon_ad_plugin 0.0.1
topon_ad_plugin: ^0.0.1 copied to clipboard
A Flutter plugin for integrating TopOn Ads using Method Channels. Supports interstitial, rewarded, banner, native, and splash ads.
π¦ ToponAdPlugin (Flutter) #
A lightweight Flutter plugin to integrate TopOn Ads using method channels. This plugin provides simple methods to initialize the SDK and display Interstitial, Rewarded, Native, Banner, and Splash ads in your Flutter apps.
π GitHub: https://github.com/jaiswal4sudeep/ToponAdPlugin
π Features #
- β Initialize TopOn SDK
- β Load & Show Interstitial Ads
- β Load & Show Rewarded Ads
- β Load & Show Native Ads
- β Load Banner Ads
- β Load Splash Ads
π¦ Installation #
Add this plugin to your pubspec.yaml file:
dependencies:
topon_ad_plugin:
path: https://github.com/jaiswal4sudeep/ToponAdPlugin
π οΈ Android Setup #
-
Add TopOn SDK dependencies to your
android/build.gradleandandroid/app/build.gradlefiles as per TopOnβs official documentation. -
Update your
AndroidManifest.xml:- Add necessary permissions.
- Include required meta-data tags.
-
Add Proguard rules (if youβre using Proguard).
π§βπ» Usage #
1οΈβ£ Initialize SDK #
final success = await ToponAdPlugin.initializeSdk(
appId: 'your_app_id',
appKey: 'your_app_key',
);
2οΈβ£ Interstitial Ads #
await ToponAdPlugin.loadInterstitialAd(placementId: 'your_interstitial_id');
final shown = await ToponAdPlugin.showInterstitialAd();
3οΈβ£ Rewarded Ads #
await ToponAdPlugin.loadRewardedAd(placementId: 'your_rewarded_id');
final shown = await ToponAdPlugin.showRewardedAd();
4οΈβ£ Native Ads #
await ToponAdPlugin.loadNativeAd(placementId: 'your_native_id');
final shown = await ToponAdPlugin.showNativeAd();
5οΈβ£ Banner Ads #
await ToponAdPlugin.loadBannerAd(placementId: 'your_banner_id');
You need to implement native view rendering for banners on both platforms.
6οΈβ£ Splash Ads #
await ToponAdPlugin.loadSplashAd(placementId: 'your_splash_id');
π§ͺ Testing Tips #
- Use real
appId,appKey, andplacementIdfrom the TopOn dashboard. - Always test ad behavior on a real device.
π License #
MIT License. Free to use, modify, and distribute.