Implement interstitial ads in Android
Implement interstitial ads in your Android app. Load ad content, display it through Java code, and use a listener to manage ad events.
Read time 1 minuteLast updated a day ago
Interstitial ad load example
UseLoadConfiguration.BuilderInterstitialAd.load()LoadListeneronAdLoadedInterstitialAdUnityAdsErrorInterstitialAd.load(loadConfig, (interstitialAd, error) -> {if (interstitialAd != null) { // Ad loaded successfully, ready to be shown this.interstitialAd = interstitialAd; } else { // Handle load error }});
Interstitial ad show example
Callshow()InterstitialAdShowConfigurationInterstitialShowListeneronStartedonClickedonCompletedonFailedUnityAdsErrorloadedInterstitialAd.show(activity, new ShowConfiguration.Builder().build(), new InterstitialShowListener(){ @Override public void onStarted(@NonNull InterstitialAd ad) { /* displayed */ } @Override public void onClicked(@NonNull InterstitialAd ad) { /* clicked */ } @Override public void onCompleted(@NonNull InterstitialAd ad, @NonNull ShowFinishState state) { /* hidden */ } @Override public void onFailed(@NonNull InterstitialAd ad, @NonNull UnityAdsError error) { /* failed */ }} );