update the plugin parameter in app.json to include react-native-google-mobile-ads and my admob info, then
run expo prebuild
it showed error Package react-native-google-mobile-ads does not contain a valid config plugin
if I ignore the above step and directly apply the code import mobileAds from 'react-native-google-mobile-ads'; mobileAds().initialize().then(adapterStatuses => {});
and import { InterstitialAd, AdEventType, TestIds } from 'react-native-google-mobile-ads'; const adUnitId =TestIds.INTERSTITIAL; const interstitial = InterstitialAd.createForAdRequest(adUnitId, {}); interstitial.load();
It showed error null is not an object (evaluating RNAppModule.eventsNotifyReady)
I think react-native-google-mobile-ads does not have a guide to install with expo as mentioned in doc?
Thanks a lot!
Hey @polygon.ww, there isn’t currently a config plugin for this library so swapping the names of the libraries in your plugins array won’t work. Also, can you point me to where we mention an installation guide in our docs? AFAIK there isn’t one so we’d want to remove that from the docs.
Note that not everything that includes native code needs a config plugin. This looks like one that does not need one. So you should not add it to your plugins array in app.json.
hi there! it’s not feasible for us to add documentation to our own website about how to use every module, however it would make sense for there to be some information on the react-native-google-mobile-ads site specific to how to use it with expo managed projects. that said, you can follow the instructions on that site and instead of following the instructions at “For the changes to take effect, rebuild your project:” you would run eas build
Thanks a lot for your help so much and I was able to install react-native-google-mobile-ads. Sorry that I misinterpreted the doc to install it as config plugin. It is okay now.