Created
May 29, 2023 07:54
-
-
Save amodkanthe/6bfa357b145cd31857251da35ca62344 to your computer and use it in GitHub Desktop.
Show an Interstitial Ad.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun showInterstialAd() { | |
InterstitialAd.load( | |
this, | |
"ca-app-pub-3940256099942544/1033173712", //Change this with your own AdUnitID! | |
AdRequest.Builder().build(), | |
object : InterstitialAdLoadCallback() { | |
override fun onAdFailedToLoad(adError: LoadAdError) { | |
} | |
override fun onAdLoaded(interstitialAd: InterstitialAd) { | |
interstitialAd.show(this@MainActivity) | |
} | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment