1

I am trying to integrate React Native Google Mobile Ads into my project and I am not sure where the European user consent should and outbound request configuration should go. For example, how should I integrate this outbound code to my app.js Full documation Outbound

import 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,

    // An array of test device IDs to allow.
    testDeviceIdentifiers: ['EMULATOR'],
  })
  .then(() => {
    // Request config successfully set!
  });
app.js

import React, {useState, useEffect} from 'react';
import {
  SafeAreaView,
  Text, Button
} from 'react-native';
import { BannerAd, BannerAdSize,InterstitialAd, AdEventType, TestIds } from 'react-native-google-mobile-ads';

export default function App() {
 
  return(
    <SafeAreaView>
      <BannerAd
      unitId={adUnitId}
      size={BannerAdSize.FULL_BANNER}
      requestOptions={{
        requestNonPersonalizedAdsOnly: true,
      }}
    />
     <Text>Hello World</Text>
    />
    </SafeAreaView>
  )
}
Babou
  • 151
  • 1
  • 12

0 Answers0