Additional Google AdMob steps - cleveradssolutions/CAS-ReactNative GitHub Wiki

Add Google Ads App ID

CAS assigns a new AdMob App ID for your application to the correct operation of all features.

Danger
You cannot use your own identifier and must replace it with a new one generated by CAS system.

You can find your Admob App ID in the CAS UI: image

  1. Click the Show AdMob App ID button.
  2. Copy the id from the form.

Android

  1. Add a <meta-data> tag with android:name="com.google.android.gms.ads.APPLICATION_ID" in your app's AndroidManifest.xml file.
  2. Insert AdMob app ID to android:value, surrounded by quotation marks, as shown below.
<manifest>
  <application>
    ...
    <!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
    <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
  </application>
</manifest>

Note that failure to add the <meta-data> tag as shown above results in a crash with the message:

The Google Mobile Ads SDK was initialized incorrectly.

iOS

  1. Add a GADApplicationIdentifier key to your app's Info.plist file.
  2. Insert AdMob app ID to <string>, as shown below.
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~1458002511 -->
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy</string>

Note that failure to add the GADApplicationIdentifier key as shown above results in a crash with the message:

The Google Mobile Ads SDK was initialized incorrectly.

Google Ads Consent for cookies (Android)

If your app has special requirements, you can use the optional setGoogleAdsConsentForCookies.
The Google Mobile Ads SDK will enable limited ads (LTD) when the setGoogleAdsConsentForCookies preference is set to false.

CAS.setGoogleAdsConsentForCookies(false)
⚠️ **GitHub.com Fallback** ⚠️