Create the AdMob app, copy each platform's App ID into this project, and set ad request options before you initialize the SDK.
Create the AdMob app
You need a Google AdMob account. Under Apps, create or choose an Android app and an iOS app. Each platform has its own App ID.
WarningA build without a valid App ID for this package crashes on start or fails to build.
Copy the App ID
Under App settings, copy the App ID.

App ID on the AdMob App settings page. Add the App ID to the project
Put each App ID in one place. Do not also paste it into
Info.plistorAndroidManifest.xml.- Expo: config plugin (
androidAppId/iosAppId). See Install with Expo.- React Native CLI: root
app.jsonsnake_case (android_app_id/ios_app_id). See Install with React Native CLI. Missing keys warn at build time and can crash the SDK on startup.
- React Native CLI: root
- Expo: config plugin (
Configure outbound requests
Call
setRequestConfigurationbeforemobileAds().initialize()when the defaults are wrong for the app. A child-directed app must limit requests to suitable content before any ad loads.jsimport mobileAds, { MaxAdContentRating } from 'react-native-google-mobile-ads'; mobileAds() .setRequestConfiguration({ // Update all future requests suitable for parental guidance maxAdContentRating: MaxAdContentRating.PG, // Indicates that you want your content treated as child-directed for purposes of COPPA. tagForChildDirectedTreatment: true, // Indicates that you want the ad request to be handled in a // manner suitable for users under the age of consent. tagForUnderAgeOfConsent: true, // Hashed ids of physical test devices; emulators and simulators are automatic. // See /testing#register-a-test-device. testDeviceIdentifiers: ['YOUR-HASHED-TEST-DEVICE-ID'], }) .then(() => { // Request config successfully set! });The fields are in the
RequestConfigurationsource.