Skip to main content

Native setup

The SDK reads your AdMob app ID from the native app config; JavaScript never passes it. Use the app ID (with ~), not an ad unit ID (with /).

iOS​

In Info.plist, add GADApplicationIdentifier and Google's SKAdNetworkItems:

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy</string>

Android​

In AndroidManifest.xml, inside <application>:

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

When the app ID is missing​

Admob.initialize() rejects, and so does every load(), because loading starts the SDK. The messages name the missing key:

PlatformMessage
iOSAdd GADApplicationIdentifier (your AdMob app ID) to Info.plist.
AndroidAdd <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-…"/> to the <application> element of AndroidManifest.xml.

A failed start is not cached: the next call tries again. Banners report the failure through onAdFailedToLoad with the code initialization-failed.

Test with Google's sample IDs​

Google publishes sample app IDs that always serve test ads. The example app uses them by default:

PlatformSample app ID
iOSca-app-pub-3940256099942544~1458002511
Androidca-app-pub-3940256099942544~3347511713

For ad units, use Admob.testAdUnitId(format) during development.

Consent (UMP) and the App Tracking Transparency prompt come from a separate package. Gather consent first, then pass the outcome to Admob.setRequestConfiguration and load ads.

Next: quick start.