val interstitialAd =AdropInterstitialAd(context, "YOUR_UNIT_ID")interstitialAd.interstitialAdListener =object : AdropInterstitialAdListener {overridefunonAdReceived(ad: AdropInterstitialAd) { Log.d("ADROP", "interstitial ad received ${ad.unitId}") ad.show() }overridefunonAdFailedToReceive(ad: AdropInterstitialAd, errorCode: AdropErrorCode) { Log.d("ADROP", "failed to receive $errorCode") }overridefunonAdFailedToShowFullScreen(ad: AdropInterstitialAd, errorCode: AdropErrorCode) { Log.d("ADROP", "failed to show full screen $errorCode") }...}interstitialAd.load()
AdropInterstitialAd interstitialAd =newAdropInterstitialAd(context,"YOUR_UNIT_ID");interstitialAd.setInterstitialAdListener(newAdropInterstitialAdListener() { @OverridepublicvoidonAdReceived(@NotNullAdropInterstitialAd ad) {Log.d("ADROP","interstitial ad received "+ad.unitId);ad.show(); } @OverridepublicvoidonAdFailedToReceive(@NotNullAdropInterstitialAd ad, @NotNullAdropErrorCode errorCode) {Log.d("ADROP","failed to received "+ errorCode); } @OverridepublicvoidonAdFailedToShowFullScreen(@NotNullAdropInterstitialAd ad, @NotNullAdropErrorCode errorCode) {Log.d("ADROP","failed to show full screen "+ errorCode); }...});interstitialAd.load();
Destroy
When you are done showing your AdropInterstitialAd, you should destroy it so that the ad is properly garbage collected.