-
-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
This guide selects the correct package, configures the Google application ID, and establishes the minimum startup sequence.
- .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
<PackageReference Include="AMDevIT.Admob.Wrapper.Droid" Version="0.1.10" /><PackageReference Include="AMDevIT.Admob.Wrapper.iOSNative" Version="0.1.10" /><PackageReference Include="AMDevIT.Admob.Wrapper" Version="0.1.10" /><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.
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.
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.
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.
- Request or refresh UMP consent.
- Stop the advertising flow if
CanRequestAdsisfalse. - Select the applicable TFAT age treatment.
- Initialize Google Mobile Ads once.
- Make banners visible or load full-screen ads only after initialization completes.
- Show a privacy-options entry point whenever UMP requires it.
Initialization is an application/session prerequisite. It must complete before any banner or full-screen ad is loaded, but it must not be repeated for every individual ad.
Continue with Privacy and Consent UMP before implementing an ad format.
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.