Soenneker.Maui.Admob
11.0.613
Prefix Reserved
dotnet add package Soenneker.Maui.Admob --version 11.0.613
NuGet\Install-Package Soenneker.Maui.Admob -Version 11.0.613
<PackageReference Include="Soenneker.Maui.Admob" Version="11.0.613" />
<PackageVersion Include="Soenneker.Maui.Admob" Version="11.0.613" />
<PackageReference Include="Soenneker.Maui.Admob" />
paket add Soenneker.Maui.Admob --version 11.0.613
#r "nuget: Soenneker.Maui.Admob, 11.0.613"
#:package Soenneker.Maui.Admob@11.0.613
#addin nuget:?package=Soenneker.Maui.Admob&version=11.0.613
#tool nuget:?package=Soenneker.Maui.Admob&version=11.0.613
Soenneker.Maui.Admob
Soenneker.Maui.Admob provides an Android BannerAd control and an iOS AdMob service for .NET MAUI applications.
Install
dotnet add package Soenneker.Maui.Admob
1. Register the package
This is the same pattern used by the demo:
using Microsoft.Extensions.Configuration;
using Soenneker.Maui.Admob.Registrars;
var builder = MauiApp.CreateBuilder();
#if ANDROID
builder.Configuration.AddInMemoryCollection(new Dictionary<string, string?>
{
["AdMob:TestMode"] = "true"
});
builder.AddAdMobService();
#endif
If you are not using test mode, configure:
AdMob:TestModeAdMob:BannerUnitIdAdMob:TestDevices
2. Add the Android AdMob app id
In Platforms/Android/AndroidManifest.xml:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713" />
That is Google's test app id. Replace it with your own app id for production.
3. Add a banner host to your page
<Grid x:Name="BannerHost" MinimumHeightRequest="60" />
4. Create the banner in C#
This matches the demo approach:
private void InitializeBanner()
{
var banner = new BannerAd
{
Size = Enums.AdmobAdSize.Banner
};
banner.OnLoaded += (_, _) =>
{
StatusLabel.Text = "Banner loaded successfully.";
};
banner.OnFailedToLoad += (_, problem) =>
{
StatusLabel.Text = $"Banner failed to load: {problem.Title}";
};
BannerHost.Children.Add(banner);
}
Banner Sizes
Available sizes:
BannerLargeBannerMediumRectangleFullBannerLeaderboardAdaptiveBannerCustom
If you use Custom, also set ContentWidth and ContentHeight.
For AdaptiveBanner, set ContentWidth to the available width in device-independent pixels. When it is omitted, the Android handler uses the current display width.
Set the size and custom dimensions before adding the control to the visual tree.
Banner Events
BannerAd exposes:
OnLoadedOnFailedToLoadOnImpressionOnClickedOnSwipedOnOpenedOnClosed
Blazor Hybrid
If you are using a MAUI Blazor Hybrid app, you may also want Soenneker.Maui.Blazor.Bridge. It may help you use this library from Blazor code.
Demo
There is a demo app here:
test/Soenneker.Maui.Admob.Demo
It shows the entire Android banner flow:
- registers
AddAdMobService() - enables AdMob test mode
- adds the Android AdMob app id
- creates and displays a
BannerAd - shows banner load/click/impression status
It uses Google's test ids, so it is safe to run as-is.
Platform behavior
- Android registers the
BannerAdhandler andIAdMobServiceUtilinitialization service. - iOS registers
IAdMobServicefor banner, interstitial, and rewarded ads. TheBannerAdcontrol itself is Android-only. - Other targets do not register an AdMob service; resolving
IAdMobServicewill fail instead of returning a null service.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. net11.0-android37.0 is compatible. net11.0-ios27.2 is compatible. |
-
net11.0
- Microsoft.Maui.Controls (>= 11.0.10)
- Soenneker.Dtos.ProblemDetails (>= 11.0.485)
- Soenneker.Gen.EnumValues (>= 11.0.67)
-
net11.0-android37.0
- Microsoft.Extensions.Configuration.Binder (>= 11.0.0)
- Microsoft.Maui.Controls (>= 11.0.10)
- Soenneker.Dtos.ProblemDetails (>= 11.0.485)
- Soenneker.Gen.EnumValues (>= 11.0.67)
- Xamarin.AndroidX.Activity.Ktx (>= 1.13.0.1)
- Xamarin.AndroidX.Fragment.Ktx (>= 1.9.1)
- Xamarin.AndroidX.Lifecycle.Process (>= 2.11.0.1)
- Xamarin.AndroidX.Lifecycle.Runtime.Ktx (>= 2.11.0.1)
- Xamarin.AndroidX.Lifecycle.Runtime.Ktx.Android (>= 2.11.0.1)
- Xamarin.AndroidX.Lifecycle.ViewModel.Ktx (>= 2.11.0.1)
- Xamarin.AndroidX.SavedState.SavedState.Ktx (>= 1.5.0.1)
- Xamarin.AndroidX.Tracing.Tracing.Ktx (>= 2.0.3)
- Xamarin.GooglePlayServices.Ads.Lite (>= 124.0.0.9)
-
net11.0-ios27.2
- Microsoft.Maui.Controls (>= 11.0.10)
- Soenneker.Dtos.ProblemDetails (>= 11.0.485)
- Soenneker.Gen.EnumValues (>= 11.0.67)
- Xamarin.Google.iOS.MobileAds (>= 8.13.0.3)
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 |
|---|---|---|
| 11.0.613 | 49 | 11/14/2026 |
| 11.0.612 | 59 | 11/12/2026 |
| 11.0.611 | 57 | 11/11/2026 |
| 11.0.610 | 46 | 11/11/2026 |
| 11.0.608 | 63 | 11/11/2026 |
| 11.0.607 | 69 | 11/10/2026 |
| 11.0.605 | 111 | 11/4/2026 |
| 11.0.604 | 98 | 10/28/2026 |
| 11.0.603 | 68 | 10/27/2026 |
| 11.0.602 | 64 | 10/26/2026 |
| 11.0.601 | 71 | 10/26/2026 |
| 11.0.600 | 69 | 10/26/2026 |
| 4.0.599 | 107 | 10/21/2026 |
| 4.0.598 | 122 | 10/14/2026 |
| 4.0.597 | 98 | 10/14/2026 |
| 4.0.596 | 99 | 10/14/2026 |
| 4.0.595 | 92 | 10/14/2026 |
| 4.0.592 | 104 | 10/14/2026 |
| 4.0.591 | 99 | 10/14/2026 |
| 4.0.590 | 103 | 10/14/2026 |
Update dependency Soenneker.Gen.EnumValues to 11.0.67 (#1247)