Additional Google AdMob steps - cleveradssolutions/CAS-ReactNative GitHub Wiki
CAS assigns a new AdMob App ID for your application to the correct operation of all features.
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:
- Click the Show AdMob App ID button.
- Copy the id from the form.
- Add a
<meta-data>
tag withandroid:name="com.google.android.gms.ads.APPLICATION_ID"
in your app'sAndroidManifest.xml
file. - 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.
- Add a
GADApplicationIdentifier
key to your app'sInfo.plist
file. - 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.
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)