Table of Contents

Class AdMobModule

Namespace
Titipi.MocaLib

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 true if an interstitial ad is loaded and ready to display.

IsRewardedAdReady()

Returns true if 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 true when the ad was shown and closed normally, or false when not shown due to cooldown, no ready ad, or a display failure.

ShowRewardedAdAsync()

Shows the rewarded ad. In the Editor, always returns true so game flow can be tested without a real device. Returns true when the user completes the ad and earns the reward, or false otherwise.

Events

OnAdRevenuePaid

Fired for every ad impression revenue event. Wire this to AppsFlyerModule.LogAdRevenue or FirebaseModule.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.