πŸ“¦ 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 Native Ads and render custom Flutter widgets
  • βœ… Load Banner Ads
  • βœ… Load Splash Ads
  • βœ… Listen to Ad Events from Native Side

πŸ“¦ Installation

Add this plugin to your pubspec.yaml:

dependencies:
  topon_ad_plugin:
    git:
      url: https://github.com/jaiswal4sudeep/ToponAdPlugin.git

πŸ› οΈ Android Setup

  1. Add TopOn SDK dependencies:
    Follow the official TopOn Android integration guide.

  2. Update your AndroidManifest.xml:

    • Add necessary permissions
    • Include required meta-data tags from TopOn
  3. Add Proguard Rules (if using Proguard)


πŸ§‘β€πŸ’» Usage

0️⃣ Set Up Ad Event Listeners (Optional)

Call this once during app startup to listen to ad lifecycle events from native code.

ToponAdPlugin.setUpListeners((event, args) {
  print('Ad Event: \$event, Data: \$args');
});

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 (Self-Rendering)

await ToponAdPlugin.loadNativeAd(placementId: 'your_native_id');
final nativeAdInfo = await ToponAdPlugin.getNativeAdInfo();
if (nativeAdInfo != null) {
  print(nativeAdInfo.title);
  // Render your custom native ad widget
}

5️⃣ Banner Ads

await ToponAdPlugin.loadBannerAd(
  placementId: 'your_banner_id',
  position: BannerPosition.bottom,
);

⚑ Note: Banner ads auto-render at top or bottom based on the provided position.


6️⃣ Splash Ads

await ToponAdPlugin.loadSplashAd(placementId: 'your_splash_id');

πŸ§ͺ Testing Tips

  • Use real appId, appKey, and placementId from the TopOn dashboard.
  • Always test ad behavior on a real device (not emulator).

πŸ“ƒ License

MIT License. Free to use, modify, and distribute.

Libraries

topon_ad_plugin