-
-
Notifications
You must be signed in to change notification settings - Fork 0
Ad Formats
The wrapper supports banner, interstitial, rewarded, and app-open ads on Android and iOS.
| Format | Android | iOS | MAUI service/control |
|---|---|---|---|
| Banner | Yes | Yes | BannerAd |
| Interstitial | Yes | Yes | IInterstitialAdService |
| Rewarded | Yes | Yes | IShowableRewardedAdService |
| App open | Yes | Yes | IAppOpenAdService |
Windows and Mac Catalyst do not run native AdMob. The MAUI banner renders a fallback template; full-screen formats are unavailable.
Banners are persistent views owned by the host screen. Create/load them only after consent permits ad requests.
| Size | Dimensions/behavior |
|---|---|
Adaptive |
Uses the available container width |
Banner |
320x50 |
LargeBanner |
320x100 |
MediumRectangle |
300x250 |
FullBanner |
468x60 |
Leaderboard |
728x90 |
Full banner and leaderboard sizes are normally tablet/desktop-width formats. Do not request a fixed size wider than the available mobile viewport.
BannerAd publishes:
-
AdLoaded/AdLoadedCommand; -
AdFailed/AdFailedCommand; -
AdClicked/AdClickedCommand; -
AdImpression/AdImpressionCommand; -
AdDismissed/AdDismissedCommand.
AdFailedEventArgs contains the native error code and error message.
Destroy low-level native banner wrappers when the owning screen is destroyed.
Interstitial ads are one-shot full-screen ads.
- Load an ad.
- Wait for the successful load callback/task.
- Show it from the current Activity or view controller.
- Reload after dismissal before showing again.
Never start overlapping loads on the same MAUI service instance.
Rewarded ads follow the same one-shot load/show lifecycle. Grant the reward
only from the native reward callback or MAUI AdRewardEarned event:
rewardedService.AdRewardEarned += (_, reward) =>
{
Console.WriteLine($"Grant {reward.Amount} {reward.Type}");
};Do not infer a reward from dismissal or impression callbacks.
App-open ads are intended for foreground-entry experiences. Before showing, confirm that an ad is loaded and that another app-open ad is not already being shown.
For low-level iOS:
if (appOpenWrapper.IsLoaded && !appOpenWrapper.IsShowing)
appOpenWrapper.ShowWithViewController(viewController);MAUI full-screen services publish:
-
AdLoaded; -
AdFailedToLoad; -
AdShown; -
AdDismissed; -
AdClicked; -
AdImpression; -
AdFailedToShow.
The dismissed event is raised after the native dismissal completes. On iOS,
willDismiss is used only for debug logging and does not raise the public
dismissed event.
Native SDK load operations cannot be cancelled after they start. A managed cancellation token cancels only the caller's wait. Wait for the native callback before issuing another load on the same object.
| Format | Test ad-unit ID |
|---|---|
| App open | ca-app-pub-3940256099942544/9257395921 |
| Banner | ca-app-pub-3940256099942544/6300978111 |
| Interstitial | ca-app-pub-3940256099942544/1033173712 |
| Rewarded | ca-app-pub-3940256099942544/5224354917 |
Never use production ad-unit IDs while clicking or repeatedly testing ads on your own devices.