Admob Interstitial Ads
What is AdMob?
AdMob is a mobile advertising subsidiary of Google, originally founded by Omar Hamoui. The name AdMob is a portmanteau for "advertising on mobile". It was incorporated on April 10, 2006 while Hamoui was in business school at Wharton School. The company is based in Mountain View, California. Wikipedia
Why use Admob?
Using AdMob, you can Earn more revenue with your apps. You work hard on your app. AdMob makes earning revenue easy with in-app ads, actionable insights, and powerful, easy-to-use tools that grow your app business.
Getting started
First, we'll need to connect our app to AdMob. You can view that guide on Sketchware's official website.
In-Sketchware configuration
You will see test ads until you SIGN APK
.
Add Admob component
First, add an AdMob component.
Give it a name, and click on Add
.
Initialisation
Load the ad in the onCreate event.
Now add the onAdLoaded event, which gets executed when the ad is loaded. Then you will need to register FullScreen content callbacks.
Now you're done. Show the ad whenever you want to, in onClick, a component event, or anywhere else. Just make sure to follow Admob's guidelines to make sure your account doesn't get suspended.
See? Piece of cake.
Component events
onInterstitialAdLoaded
Gets executed when the interstitial ad is successfully loaded.
onAdDismissedFullScreenControl
Gets executed when the ad is closed by the user.
onInterstitialAdFailedToLoad
When Admob fails to load the ad, this event gets executed.
onAdFailedToShowFullScreen
When the ad loads but it fails to display it.
onAdShowedFullScreen
When it succeeds to show the ad.
Available blocks
Load ad
Load the ad. Recommended to add in onCreate event.
Register Fullscreen Content Callbacks
Registers fullscreen content callbacks. Must add in onAdLoaded event.
Show ad
Shows the fullscreen interstitial ad.