Skip to main content

setRequestConfiguration

Use this function to configure Ad requests globally.

Usage example

import AdMob from '@react-native-admob/admob';

const config = {
testDeviceIds: ["YOUR_TEST_DEVICE_ID"],
maxAdContentRating: "MA",
tagForChildDirectedTreatment: false,
tagForUnderAgeConsent: false,
};

export default function App() {
useEffect(() => {
AdMob.setRequestConfiguration(config);
}, []);

return (/* Your App code */)

Arguments

config

Configuration object that collects targeting information to be applied globally.

Type
object

Properties:

ConfigurationsTypeDescrition
testDeviceIdsstring[]
maxAdContentRatingMaxAdContentRating
tagForChildDirectedTreatmentboolean
tagForUnderAgeConsentboolean

Type Definitions

MaxAdContentRating

Type
string

Avaliable values:

NameDescription
G"General audiences." Content suitable for all audiences, including families and children.
MA"Mature audiences." Content suitable only for mature audiences; includes topics such as alcohol, gambling, sexual content, and weapons.
PG"Parental guidance." Content suitable for most audiences with parental guidance, including topics like non-realistic, cartoonish violence.
T"Teen." Content suitable for teen and older audiences, including topics such as general health, social networks, scary imagery, and fight sports.