1

I use AdMob from react native firebase. I follow documentation, install @react-native-firebase/app and @react-native-firebase/admob,

create firebase.json

{
  "react-native": {
   "admob_android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx",
   "admob_ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx"
 }
}

after that run cd ios/ && pod install, and set the request configuration and European User Consent like in docs.

After that create a component for ads and set unit id

import React from 'react';
import {Platform} from 'react-native';
import {BannerAd, BannerAdSize} from '@react-native-firebase/admob';

function Banner320X100() {

let adUnitId3 =
Platform.OS === 'ios'
  ? 'ca-app-pub-xxxxxxxx/xxxxxxxx'
  : 'ca-app-pub-xxxxxxxx/xxxxxxxx';

return (
<BannerAd
  unitId={adUnitId3}
  size={BannerAdSize.LARGE_BANNER}
  requestOptions={{
    requestNonPersonalizedAdsOnly: true,
  }}
/>
);
}

export default Banner320X100;

I edit info.plist

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxx~xxxxxxxx</string>
<key>GADIsAdManagerApp</key>
<true/>

On android work well, on ios only test ads work. Did I forget anything?

I get error

enter image description here

Ismeet
  • 419
  • 5
  • 19

0 Answers0