Skip to content

Testing and Troubleshooting

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

Testing and Troubleshooting

Test privacy, initialization, loading, presentation, and lifecycle behavior before using production ad-unit IDs.

Test applications

The repository includes:

  • AMDevIT.Admob.Wrapper.DroidTestApp for native Android;
  • AMDevIT.Admob.Wrapper.AppleTestApp for native iOS;
  • AMDevIT.Admob.Wrapper.MAUITestApp for Android, iOS, Windows, and Mac Catalyst;
  • AMDevIT.Admob.Wrapper.MAUICross.Tests for managed full-screen lifecycle and desktop consent-placeholder tests.

The Apple app covers UMP, privacy options, IAppleLogger, adaptive banners, interstitial, rewarded, and app-open. The MAUI app delays mobile banner materialization until consent succeeds and displays the desktop fallback.

Google test IDs

Application ID:

ca-app-pub-3940256099942544~3347511713
Format Test ad-unit ID
App open ca-app-pub-3940256099942544/9257395921
Banner ca-app-pub-3940256099942544/6300978111
Interstitial ca-app-pub-3940256099942544/1033173712
Rewarded ca-app-pub-3940256099942544/5224354917
Rewarded interstitial ca-app-pub-3940256099942544/5354046379
Native ca-app-pub-3940256099942544/2247696110

Consent test matrix

Test at least:

  1. first launch with required consent;
  2. returning user with valid state;
  3. consent refresh error with previous CanRequestAds == true;
  4. consent state that does not allow ad requests;
  5. privacy-options form when required;
  6. under-age setting;
  7. reset followed by a new consent flow;
  8. EEA debug geography using a registered test device;
  9. no-op behavior on Windows and Mac Catalyst.

Never ship debug geography or test-device identifiers in production.

Ad lifecycle matrix

For every mobile format verify:

  • successful load;
  • no-fill/load failure and native error code;
  • successful presentation;
  • click and impression callbacks;
  • failed-to-show callback;
  • dismissal timing;
  • repeated load after dismissal;
  • orientation/container-width changes for adaptive banners;
  • reward granted only from the reward callback.

Common problems

Ads load before consent

Do not instantiate/show a mobile banner or call a full-screen load before the UMP workflow allows requests. In MAUI, bind banner visibility to a startup state that becomes true only after consent and initialization.

PlatformNotSupportedException on desktop

Consent is a no-op on desktop, but full-screen ads are not. Hide mobile-only commands and use FallbackTemplate. See Desktop Fallbacks.

Another load is already active

One MAUI full-screen service instance supports one native load at a time. Caller cancellation does not cancel native work. Wait for the callback before starting another load.

Android dependency conflicts

Remove Xamarin.GooglePlayServices.Ads. The project uses Mobile Ads Next-Gen. Do not add an explicit UMP dependency to the native Gradle module.

iOS application ID error

Verify GADApplicationIdentifier in Info.plist and confirm the presenting UIViewController is visible before UMP or full-screen presentation.

No logs

Enable a Microsoft.Extensions.Logging provider before UseAMDevITAdMobWrapper, or supply IDroidLogger/IAppleLogger to low-level constructors.

Release checklist

  • Build every target used by the application.
  • Run managed tests.
  • Use exact release-candidate NuGet packages in a real consumer.
  • Run Android and iOS tests on physical devices.
  • Verify privacy options remain reachable when required.
  • Remove consent debug settings.
  • Replace test IDs only after development testing is complete.
  • Review native warning/error logs.

Clone this wiki locally