MarcTron.Admob 1.8.0

.NET Standard 2.0
NuGet\Install-Package MarcTron.Admob -Version 1.8.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
dotnet add package MarcTron.Admob --version 1.8.0
<PackageReference Include="MarcTron.Admob" Version="1.8.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MarcTron.Admob --version 1.8.0
#r "nuget: MarcTron.Admob, 1.8.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install MarcTron.Admob as a Cake Addin
#addin nuget:?package=MarcTron.Admob&version=1.8.0

// Install MarcTron.Admob as a Cake Tool
#tool nuget:?package=MarcTron.Admob&version=1.8.0

MtAdmob plugin for Xamarin

With this Plugin you can add a Google Admob Ads inside your Xamarin Android and iOS Projects with a single line!!! This plugin supports: Banners, Interstitial and Rewarded Videos

Please, support me

If possible, please, support my work with few coffees or even better with a Membership! You can do it here: Buy Me A Coffee Your help allows me to continue to spend time on this project and continue to maintain and update it with new features and to be ready for the new Google SDK 20: Google SDK 20 Migration.


  • On Android you need to add your Admob APPLICATION_ID to your AppManifest.

  • On iOS you need to add GADApplicationIdentifier to your Info.plist: Edit your info.plist adding these Keys: <key>GADApplicationIdentifier</key> <string>ca-app-pub-3940256099942544~1458002511</string> ← This is a test key, replace it with your APPID <key>GADIsAdManagerApp</key> <true/>

  • If you don't do this, your iOS app will crash

  • I'm slowly starting to move toward AndroidX, so it's possible that you need to install more packages in your Android project, in case of a build error, Visual Studio will tell you which packages you need to install.

To add a Banner on a page you have two options:

<controls:MTAdView x:Name="myAds"></controls:MTAdView>

remember to add this line in your XAML:

MTAdView ads = new MTAdView();

Now you can add the control to your layout.


To test the banner during the development google uses two Banner Id, one for Android and the other for iOS. Use them then remember to replace them with your own IDs:

Android: ca-app-pub-3940256099942544/6300978111
iOS: ca-app-pub-3940256099942544/2934735716

If the Banners don't appear in your app, probably it's a size problem. To solve it, add this style you your app.xaml:

<Style TargetType="controls:MTAdView">
    <Setter Property="HeightRequest">
            <x:OnIdiom Phone="50" Tablet="90"></x:OnIdiom>


For each AdView if you want, you can set this property: AdsId: To add the id of your ads

For GDPR it's better to rely on a custom consent instead or using the non personalized ads as I cannot guarantee it works. So it's better if you create a custom consent


AdsId: To add the id of your ads

PersonalizedAds: You can set it to False if you want to use generic ads (for GDPR...) (It works only for Android Banners, for the others, you must ask for consent) For GDPR it's better to rely on a custom consent instead or using the non personalized ads as I cannot guarantee it works. So it's better if you create a custom consent

TestDevices: You can add here the ID of your test devices

UseRestrictedDataProcessing: For compliance with the CCPA

You can use Global Properties in this way: CrossMTAdmob.Current.UserPersonalizedAds = true;


You can show an interstitial with a single line of code:


To Load an interstitial you can use this line:



You can show a Rewarded video with a single line of code:


To Load a Rewarded Video you can use this line:



Just in case you need, the Banner ads offer 4 events:

AdsClicked		    When a user clicks on the ads
AdsClosed		    When the user closes the ads
AdsImpression	    Called when an impression is recorded for an ad.
AdsOpened		    When the ads is opened


the Interstitial ads offer 3 events:

OnInterstitialLoaded        When it's loaded
OnInterstitialOpened        When it's opened      
OnInterstitialClosed        When it's closed


The Rewarded Videos offer 7 events:

OnRewarded                          When the user gets a reward
OnRewardedVideoAdClosed             When the ads is closed
OnRewardedVideoAdFailedToLoad       When the ads fails to load
OnRewardedVideoAdLeftApplication    When the users leaves the application
OnRewardedVideoAdLoaded             When the ads is loaded
OnRewardedVideoAdOpened             When the ads is opened
OnRewardedVideoStarted              When the ads starts


Remember to include the MTAdmob library with this code (usually it's added automatically):

using MarcTron.Plugin;


Before loading ads, you need to call MobileAds.initialize() on OnCreate:

protected override void OnCreate(Bundle savedInstanceState)
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;

            MobileAds.Initialize(ApplicationContext, );
            Xamarin.Forms.Forms.Init(this, savedInstanceState); 
            LoadApplication(new App());

Remeber to add this to your AppManifest:

<meta-data android:name=""


**In case the plugin doesn't install automatically the nuget package


you need to add it manually.**

That's it. Cannot be easier than that πŸ˜ƒ

Available on Nuget:


To report any issue:

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid monoandroid12.0
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Universal Windows Platform uap10.0.18362
Xamarin.iOS xamarinios xamarinios10
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.8.0 1,179 7/3/2022
1.6.9 4,107 12/23/2021
1.6.8 6,686 11/23/2021
1.6.7 908 10/16/2021
1.6.6 318 10/12/2021
1.6.5 1,274 8/24/2021
1.6.4 340 8/22/2021
1.6.3 490 8/16/2021
1.6.2 292 8/14/2021
1.6.1 5,168 1/23/2021
1.6.0 4,386 11/7/2020
1.5.8 2,659 9/27/2020
1.5.7 2,228 8/1/2020
1.5.6 2,139 6/7/2020
1.5.5 1,593 5/10/2020
1.5.0 915 4/11/2020
1.4.5 2,255 11/19/2019
1.4.4 883 10/11/2019
1.4.3 435 10/7/2019
1.4.2 527 9/7/2019
1.4.1 805 8/12/2019
1.4.0 521 8/2/2019
1.3.0 690 6/1/2019
1.2.0 550 4/8/2019
1.1.0 485 3/22/2019
1.0.0 491 3/5/2019

Version 1.8.0
Updated Xamarin.GooglePlayServices.Ads.Lite to
Updated Xamarin.Google.iOS.MobileAds to
Code updated to support new Ads libraries

Version 1.7.0
Added banner click support for iOS (thanks to alex-relov)

Version 1.6.9
Updated  Xamarin.GooglePlayServices.Ads.Lite to
Removed MyRewardedVideoAdListener
Enabled OnRewardedVideoAdLoaded On Android
Enabled OnRewardedVideoAdFailedToLoad On Android
Enabled OnRewardedVideoAdClosed On Android

Version 1.6.8
Replaced AdSize.SmartBanner as deprecated (thanks to roswer13)
Improved AdFailedToLoad (thanks to roswer13)

Version 1.6.7
Fixed OnRewardedVideoAdCompleted on Android
Updated Xamarin.GooglePlayServices.Ads.Lite to

Version 1.6.6
Fixed OnRewardedVideoAdLoaded on Android

Version 1.6.5
Fixed missing events for rewarded video on Android (Regression)

Version 1.6.4
Fixed issue with ADs request on Android
Replaced string consts for content rating filter

Version 1.6.3
Fixed missing events for rewarded video on Android

Version 1.6.2
Updated GooglePlayServices.Ads.Lite to 120.2.0
Updated Xamarin.AndroidX.Annotation to 1.2.0
Removed Personalized property from MTAdView

Version 1.6.1
Removed support for MonoAndroid81
Updated GooglePlayServices.Ads.Lite to 119.6.0

Version 1.6.0
Updated Xamarin.Google.iOS.MobileAds to 7.66 (Required for iOS 14+)
Updated GooglePlayServices.Ads.Lite to 119.1.0

Version 1.5.8
Added support for Comply with Google Play’s Families Policy (Thanks to Abdul Rahman)

Version 1.5.7
Added IsEnabled to disable the ads (banners, interstitials, rewarded videos) (Default = true)
Added UseRestrictedDataProcessing for CCPA compliance (Default = false)

Version 1.5.6
Fixed possible issue with some MONODROID versions for LoadRewardedVideo

Version 1.5.5
Updated MobileAds to 7.57.0 to avoid Apple rejection because of the reference to UIWebView

Version 1.5.0
Updated packages
Improved code
Add custom data to RewardedAd (thanks to Lordinaire)

Version 1.4.5
Automatically added Google.SignIn 4.4.0 (This version is required to compile your project).

Version 1.4.4
Removed deprecated code on iOS
Fixed issues on iOS (Please update from version 1.4.3 and read the README to init your projects)

Version 1.4.3
Added Consent option to iOS
Updated Xamarin.Google.iOS.MobileAds to 7.47.0

Version 1.4.2
Updated GooglePlayServicesAds.Lite 71.1720.1

Version 1.4.1
Fixed issue on iOS where some events weren't called on RewardedVideos in case of no internet

Version 1.4
Fixed issue with multiple events called on RewardedVideos
Improved code for Interstitials.

Version 1.3
Fixed crash on iOS with multiple Banner
To avoid compatibilty now the Banner control has been renamed from AdView to MTAdView

Version 1.2
Now Load and Show are two separate methods to give you more control over your Ads

Version 1.1
Added support for Rewarded Videos
Added events for Rewarded Videos
Added events for Interstitials

Version 1.0
Banner and Insterstitial for Android
Banner and Insterstitial for iOS