Skip to main content

Flutter - Interstitial Ad

Overview


This guideline will instruct you to integrate Vpon Interstitial Ad with Vpon Flutter Plugin. You can alse check this guideline and the information about the plugin on pub.dev.

Interstitial Ad Implementation

Declare a Interstitial Ad Object


InterstitialAd? _interstitialAd;

Load Interstitial Ad


 void _loadInterstitialAd() {
    VponAdRequest request = VponAdRequest();

    InterstitialAd.load(
        licenseKey: 'Your license key',
        request: request,
        adLoadCallback: InterstitialAdLoadCallback(
            onAdLoaded: (InterstitialAd ad) {
                _interstitialAd = ad;
            },
            onAdFailedToLoad: (Map error) {
                _interstitialAd = null;
            },
            onAdImpression: (InterstitialAd ad) {
                // handle impression
            },
            onAdClicked: (InterstitialAd ad) {
                // handle click
            },
            onAdWillDismissFullScreenContent: (InterstitialAd ad) {
                // handle callback
            },
            onAdDismissedFullScreenContent: (InterstitialAd ad) {
                // handle callback
            },
            onAdWillShowFullScreenContent: (InterstitialAd ad) {
                // handle callback
            },
        ),
    );
  }

Note: You can listen to ad events by implementing InterstitialAdLoadCallback.

Show Interstitial Ad


_interstitialAd.show();