Skip to content

Getting Started

Alessandro Morvillo edited this page Aug 2, 2026 · 1 revision

Getting Started

This guide selects the correct package, configures the Google application ID, and establishes the minimum startup sequence.

Requirements

  • .NET 10
  • Android API 33 or later
  • iOS 15.0 or later
  • Mac Catalyst 15.0 or later for MAUI fallback UI
  • Windows 10 version 1809 or later for MAUI fallback UI

Choose a package

Native Android binding

<PackageReference Include="AMDevIT.Admob.Wrapper.Droid" Version="0.1.10" />

Native iOS binding

<PackageReference Include="AMDevIT.Admob.Wrapper.iOSNative" Version="0.1.10" />

Android or iOS with async extensions

<PackageReference Include="AMDevIT.Admob.Wrapper" Version="0.1.10" />

.NET MAUI

<PackageReference Include="AMDevIT.Admob.Wrapper.MAUICross" Version="0.1.10" />

AMDevIT.Admob.Wrapper.MAUICross already depends on the shared wrapper. Add a direct shared-wrapper reference only if your application itself calls the lower-level native extension methods.

Android application ID

Add the AdMob application ID inside the <application> element of AndroidManifest.xml:

<application ...>
    <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY" />
</application>

Android uses Google Mobile Ads SDK Next-Gen. Do not add the legacy Xamarin.GooglePlayServices.Ads package and do not add UMP as an explicit dependency to the native Gradle module.

iOS application ID

Add the application ID to Info.plist:

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY</string>

The native framework uses Google's official swift-package-manager-google-mobile-ads dependency. Its UMP dependency is transitive; do not add a second UMP Swift package.

Register MAUI services

In MauiProgram.cs:

using AMDevIT.Admob.Wrapper.MAUICross;

builder.Logging.AddDebug();
builder.UseAMDevITAdMobWrapper();

This registers banner handlers, full-screen services, context resolution, native logger adapters, and IAdMobConsentService.

Required startup order

  1. Request or refresh UMP consent.
  2. Stop the advertising flow if CanRequestAds is false.
  3. Initialize Google Mobile Ads.
  4. Make banners visible or load full-screen ads.
  5. Show a privacy-options entry point whenever UMP requires it.

Continue with Privacy and Consent UMP before implementing an ad format.

Google test application ID

Use Google's sample application ID during development:

ca-app-pub-3940256099942544~3347511713

Use only Google test ad-unit IDs while developing. See Testing and Troubleshooting.

Clone this wiki locally