Class AdMobModule
Wraps the Google Mobile Ads (AdMob) Unity SDK for Banner, Interstitial, and Rewarded ad formats. Not supported on WebGL.
public static class AdMobModule
- Inheritance
-
AdMobModule
- Inherited Members
Properties
- Config
The config used to initialize this module.
- IsInitialized
Whether the AdMob SDK has been initialized successfully.
Initialization
- InitializeAsync(AdMobModuleConfig)
Initializes the Google Mobile Ads SDK, wires ad callbacks, and begins preloading ads.
Methods
- HideBannerAd()
Hides the banner ad without destroying it. Subsequent calls to ShowBannerAd() will restore it instantly.
- IsInterstitialAdReady()
Returns
trueif an interstitial ad is loaded and ready to display.
- IsRewardedAdReady()
Returns
trueif a rewarded ad is loaded and ready to display.
- ShowBannerAd()
Shows the banner ad at the bottom-center position. Remembers visibility so the banner is restored after app resume.
- ShowInterstitialAdAsync()
Shows the interstitial ad. Respects the InterstitialInterval cooldown between consecutive shows. Returns
truewhen the ad was shown and closed normally, orfalsewhen not shown due to cooldown, no ready ad, or a display failure.
- ShowRewardedAdAsync()
Shows the rewarded ad. In the Editor, always returns
trueso game flow can be tested without a real device. Returnstruewhen the user completes the ad and earns the reward, orfalseotherwise.
Events
- OnAdRevenuePaid
Fired for every ad impression revenue event. Wire this to
AppsFlyerModule.LogAdRevenueorFirebaseModule.LogAdRevenue.
- OnBannerAdLoaded
Fired when a Banner ad has loaded.
- OnInterstitialAdClosed
Fired when an Interstitial ad is dismissed by the user.
- OnInterstitialAdLoaded
Fired when an Interstitial ad has loaded and is ready to show.
- OnRewardedAdClosed
Fired when a Rewarded ad is dismissed by the user.
- OnRewardedAdLoaded
Fired when a Rewarded ad has loaded and is ready to show.