Plugin.MauiMTAdmob
3.0.0
dotnet add package Plugin.MauiMTAdmob --version 3.0.0
NuGet\Install-Package Plugin.MauiMTAdmob -Version 3.0.0
<PackageReference Include="Plugin.MauiMTAdmob" Version="3.0.0" />
<PackageVersion Include="Plugin.MauiMTAdmob" Version="3.0.0" />
<PackageReference Include="Plugin.MauiMTAdmob" />
paket add Plugin.MauiMTAdmob --version 3.0.0
#r "nuget: Plugin.MauiMTAdmob, 3.0.0"
#:package Plugin.MauiMTAdmob@3.0.0
#addin nuget:?package=Plugin.MauiMTAdmob&version=3.0.0
#tool nuget:?package=Plugin.MauiMTAdmob&version=3.0.0
MAUIMtAdmob plugin for MAUI (Android & iOS)
With this Plugin you can add Google Admob Ads inside your MAUI Projects with a single line of code!!! This plugin supports: Banners, Collapsible Banners, Interstitials, Rewarded, Rewarded Interstitials, App Open Ads, Native Ads and Consent (only in the licensed version).
Version 3: Google Mobile Ads Next-Gen SDK
From version 3.0, Android runs on Google's Google Mobile Ads Next-Gen SDK, which Google has made the preferred SDK for Android. iOS keeps using the Google Mobile Ads SDK 12.x, because Google has not released a Next-Gen SDK for iOS.
The public API is the same as in 2.x. The namespace, the controls, the events and every method signature are unchanged, so updating is normally just a package update (see Updating from 2.x below).
Which version should you use?
- 3.x (this version): Android on the Next-Gen SDK. Requires Android minSdk 24.
- 2.x: Android on the legacy Google Mobile Ads SDK. Still maintained for apps that cannot move yet: apps that need minSdk below 24, or that mediate through a platform other than AdMob.
PLEASE READ
Support for the consent required by Google for all the final users living in Europe (UMP) is only available in the licensed version of the plugin, together with App Open Ads and Native Ads. Without the license, the plugin will continue to work as usual with all the other features normally available. This will allow me to continue supporting the development of the plugin. You can buy the license at https://hightouchinnovation.com/MMTAdmob If you are a charity or your app is used to support a good cause, contact me and I'll evaluate it to send you a free license.
Licence keys and version 3: a "1 Major Version" licence is valid for the major version it was bought for. A key bought for 2.x keeps working on every 2.x release, but not on 3.x: to use the licensed features on 3.x you need a 3.x key. Perpetual ("Supporter") licences are valid for all versions, including 3.x.
Setup
- Available on Nuget: https://www.nuget.org/packages/Plugin.MauiMTAdmob/
- Install in your MAUI project
This plugin supports:
- Maui (Android and iOS)
- .NET 10
- Android 7.0 (API 24) and later, iOS 15.4 and later
Updating from 2.x
- Update
Plugin.MauiMTAdmobto 3.x. - Raise your Android
SupportedOSPlatformVersionto 24.0 in your app's csproj. The Next-Gen SDK requires minSdk 24, whereas 2.x allowed 21:
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
- Leave your code as it is.
Everything else (.UseMauiMTAdmob(), CrossMauiMTAdmob.Current, MTAdView, MTNativeAdView,
the events, the consent calls) is unchanged.
Behaviour differences on Android
- Initialisation runs in the background. The Next-Gen SDK fails if an ad is loaded before it has
finished initialising, and its initialisation must not run on the UI thread. The plugin runs it for
you inside
Init(...)on a background thread, and anyLoad*,SetAppMuted,SetAppVolumeorOpenAdInspectorcall made while it is still running is queued and executed as soon as it finishes, so code that loads an ad right afterInitkeeps working.OnMobileAdsInitializedis raised once the queued work has started. - With AdMob mediation, the first request may not have every adapter ready. The Next-Gen SDK only
reports mediation adapter initialisation once every adapter is ready or a 30 second timeout
elapses. Waiting for it would stall banners for up to half a minute, so the plugin raises
OnMobileAdsInitializedas soon as the SDK itself is ready, as Google's own sample app does. - Error codes are unchanged, the domain is not.
MTEventArgs.ErrorCodekeeps Google's numeric codes (2= network error,3= no fill,8= app id missing, ...), so existing comparisons keep working.ErrorDomainis nowcom.google.android.libraries.ads.mobile.sdk(it wascom.google.android.gms.ads). - Child-directed / under-age tags become an age treatment. The Next-Gen SDK replaced
TagForChildDirectedTreatmentandTagForUnderAgeOfConsentwith a single age treatment. The plugin keeps both properties and applies Google's documented mapping: if either isTruethe request gets the child treatment, otherwise none. - Anchored adaptive banners use Google's "large" size.
AnchoredAdaptive(andSmart, which the Next-Gen SDK removed) request the large anchored adaptive size Google recommends, which can be slightly taller. - Banner refreshes raise
AdsLoadedagain, and the banner's height follows the new creative. - Interstitials ignore the Android back key, as the Next-Gen SDK does. Users close them with the close button.
- Ad Manager and AdMob requests are unified in the Next-Gen SDK. The
LoadAdManager*/ShowAdManager*methods still exist and keep their own ad queues, so your code does not change. - Mediation. The Next-Gen SDK only supports AdMob mediation. If you mediate through another platform, stay on 2.x for now.
Impression-level ad revenue, Ad Inspector, privacy and targeting
CrossMauiMTAdmob.Current.OnAdPaidreports the revenue of every ad (banner, interstitial, rewarded, rewarded interstitial, app open and native) with its format, ad unit, value, currency, precision and ad source - forward it to Firebase or your attribution SDK. Enable impression-level ad revenue in the AdMob UI for the values to be populated.CrossMauiMTAdmob.Current.OpenAdInspector()opens Google's Ad Inspector (test devices only);OnAdInspectorClosedreports when it closes or why it could not open.PublisherPrivacyPersonalizationStatesets Google's publisher privacy treatment (Disabledturns off personalized ads for the session).ContentUrlandNeighboringContentUrlssend content mapping with every request.CustomTargetingsends key-value targeting with every request (Google Ad Manager).
Native ads
Give the MTMediaView in your native ad template at least 120x120: Google requires it for video ads,
and the native ad validator flags anything smaller. Avoid * rows around the media view in a Grid
template, because they can shrink it below its requested size.
Android
You still need your Admob APPLICATION_ID in your AndroidManifest.xml (the UMP SDK reads it from there):
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="YOUR APPLICATION ID" />
iOS
You need to add GADApplicationIdentifier to your Info.plist. Edit your info.plist adding these Keys:
<key>GADApplicationIdentifier</key>
<string>YOUR APPLICATION ID</string>
<key>GADIsAdManagerApp</key>
<true/>
To show the App Tracking Transparency dialog (the plugin asks for it after the consent form), also add:
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
Without this key iOS never shows the dialog and tracking is always denied.
Consent not showing?
Turn on debug mode (CrossMauiMTAdmob.Current.DebugMode = true, or debugMode: true in Init): the plugin then logs each step of the consent flow, prefixed with [MauiMTAdmob], so you can tell a form that was not required from one that failed.
VERY IMPORTANT
If you encounter an error on this plugin check the guide at https://hightouchinnovation.com/MMTAdmobGuide where you can find also common issues and how to solve them.
You can also report any issue at https://github.com/marcojak/MauiMTAdmob/issues
The Consent might not work on the iOS simulator (it usually depends on the xCode version you have installed on your Mac). If it doesn't work, you can change your XCode version or test it on a real device.
To test the plugin on iOS you need to use a Mac as the device directly connected to Windows is not supported.
FOR MAC USERS WITH Mx PROCESSORS
If you compile the app on a Mac with Mx processors, you could get an error about architecture, to fix it, add to your csproj file these lines:
<PropertyGroup Condition="$(TargetFramework.Contains('-ios'))">
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup>
<ForceSimulatorX64ArchitectureInIDE>true</ForceSimulatorX64ArchitectureInIDE>
</PropertyGroup>
How to use MauiMTAdmob
In your MauiProgram class, add
builder.UseMauiMTAdmob();
You can find the full guide here: https://hightouchinnovation.com/MMTAdmobGuide
LINKS
To buy the license visit https://hightouchinnovation.com/MMTAdmob Available on Nuget: https://www.nuget.org/packages/Plugin.MauiMTAdmob/ Guide: https://hightouchinnovation.com/MMTAdmobGuide (you'll find here also the common issues and how to solve them) Release notes: https://github.com/marcojak/MauiMTAdmob/blob/master/CHANGELOG.md To report any issue: https://github.com/marcojak/MauiMTAdmob/issues
CRYPTOGRAPHY
This plugin uses a cryptographic algorithm to handle the license.
DISCLAIMER OF LIABILITY
By using MAUIMtAdmob (the "Plugin"), you agree that:
- The Plugin is provided "as is" without any warranties or guarantees of any kind, either expressed or implied.
- I shall not be responsible or liable for any direct, indirect, incidental, special, or consequential damages arising out of the use or inability to use the Plugin.
- I do not warrant that the Plugin will meet your specific requirements or operate without interruption.
You acknowledge that the use of the Plugin is at your own risk. The author of the plugin disclaims all liability for any damage to your computer system or loss of data that results from the use of the Plugin.
This disclaimer of liability is a fundamental part of the agreement between you and the author of the plugin. You agree that the limitations and exclusions of liability set forth in this disclaimer are reasonable and fair.
If you do not agree to these terms, do not use the Plugin.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-android36.0 is compatible. net10.0-browser was computed. net10.0-ios was computed. net10.0-ios26.0 is compatible. net10.0-maccatalyst was computed. net10.0-maccatalyst26.0 is compatible. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net10.0-windows10.0.19041 is compatible. |
-
net10.0
- Microsoft.Maui.Controls (>= 10.0.10)
-
net10.0-android36.0
- Microsoft.Maui.Controls (>= 10.0.10)
- Xamarin.AndroidX.Fragment.Ktx (>= 1.9.0)
- Xamarin.Google.Android.Libraries.Ads.Mobile.Sdk (>= 1.4.0)
- Xamarin.Google.UserMessagingPlatform (>= 4.0.0.4)
-
net10.0-ios26.0
- Microsoft.Maui.Controls (>= 10.0.10)
- MTAdmob.iOS.Binding (>= 12.12.0)
- MTAdmob.UMP.iOS.Binding (>= 3.0.0)
- Portable.BouncyCastle (>= 1.9.0)
-
net10.0-maccatalyst26.0
- Microsoft.Maui.Controls (>= 10.0.10)
-
net10.0-windows10.0.19041
- Microsoft.Maui.Controls (>= 10.0.10)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Plugin.MauiMTAdmob:
| Package | Downloads |
|---|---|
|
MetaFrm.Maui.Essentials.net8.0
Meta Framework (Multi platform & Meta management) |
|
|
MetaFrm.Maui.Essentials.net9.0
Meta Framework (Multi platform & Meta management) |
|
|
MetaFrm.Maui.Essentials.net7.0
Meta Framework (Multi platform & Meta management) |
|
|
MetaFrm.Maui.Essentials.net10.0
Meta Framework (Multi platform & Meta management) |
|
|
AnchorAppsIT.MAUI.Controls
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 918 | 10/16/2026 |
| 2.6.0 | 175 | 10/16/2026 |
| 2.5.1 | 173 | 10/13/2026 |
| 2.5.0 | 461 | 10/5/2026 |
| 2.4.0 | 8,843 | 3/18/2026 |
| 2.3.1 | 1,686 | 2/1/2026 |
| 2.3.0 | 316 | 1/30/2026 |
| 2.2.0 | 4,229 | 11/5/2025 |
| 2.1.0 | 1,240 | 10/8/2025 |
| 2.0.2 | 16,134 | 5/21/2025 |
| 2.0.1.1 | 840 | 5/2/2025 |
| 2.0.1 | 614 | 5/1/2025 |
| 2.0.0.5 | 3,210 | 2/14/2025 |
| 1.7.1 | 3,218 | 11/27/2024 |
| 1.7.0 | 1,092 | 11/2/2024 |
| 1.6.4 | 3,970 | 9/17/2024 |
| 1.6.3 | 2,565 | 9/3/2024 |
| 1.6.2 | 525 | 9/1/2024 |
| 1.6.1 | 625 | 8/30/2024 |
| 1.6.0 | 832 | 8/23/2024 |
Version 3.0 moves Android to Google's Mobile Ads Next-Gen SDK. The public API is unchanged: update the package, raise your Android SupportedOSPlatformVersion to 24.0, and keep your code as it is.
- Android: Google Mobile Ads Next-Gen SDK 1.4.0 (Microsoft binding Xamarin.Google.Android.Libraries.Ads.Mobile.Sdk) replaces Xamarin.GooglePlayServices.Ads.Lite. Android minSdk is now 24 (was 21).
- iOS: unchanged, Google Mobile Ads SDK 12.12.0 (Google has no Next-Gen SDK for iOS).
- New: OnAdPaid (impression-level ad revenue), OpenAdInspector / OnAdInspectorClosed, PublisherPrivacyPersonalizationState, ContentUrl / NeighboringContentUrls and CustomTargeting.
- Fixed (Android): native ads now resize to their template, so assets no longer spill outside the native ad view.
- Only AdMob mediation is supported on Android. Stay on 2.x if you need another mediation platform or minSdk below 24.
- Licensing: a "1 Major Version" licence key bought for 2.x does not unlock the licensed features on 3.x; you need a 3.x key. Perpetual licences are valid for all versions.
Full notes: https://github.com/marcojak/MauiMTAdmob/blob/master/CHANGELOG.md