What version of Expo should I use to integrate react-native-google-mobile-ads?

94 Views Asked by At

What is the recommended version of the expo to integrate react-native-google-mobile-ads?

I have tried integrating the react-native-google-mobile-ads with Expo v48. But unfortunately, I got an error.

**Error:** "Invariant Violation: requireNativeComponent: 'RNGoogleMobileAdsBannerView' was not found in the UIManager".
# app.json

{
    "expo": {
    ...
    },
    "react-native-google-mobile-ads": {
      "android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx"
    }
  }
  
1

There are 1 best solutions below

9
bagi2info.com On

make sure you follow the setup properly, add admob id on app.json config

// <project-root>/app.json
{
  "expo": {
    // ...
  },
  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx",
    "ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx"
  }
}

Source: https://docs.page/invertase/react-native-google-mobile-ads