I have an Expo app that works well. Now, I would like to add a few ads before publishing it on Play Store in order to make a few bucks. Expo says their in-house ads package is deprecated and that I must use react-native-google-mobile-ads
.
Because react-native-google-mobile-ads
is a native package, it means I need to perform special tasks, and it's a bit unclear on how to proceed from here.
From what I've understood, I need to:
install
expo-dev-client
andreact-native-google-mobile-ads
add
react-native-google-mobile-ads
in the app.json 'sexpo plugin
"expo": { "plugins": ["react-native-google-mobile-ads"]}
- add my adMob api key in
app.json
"react-native-google-mobile-ads": {
"android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx",
"ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx"
}
create an account on
https://expo.dev
and runeas login
in my terminalthen
run eas build --profile development --platform android
to generate a buildsince expo-go won't work anymore because of the native package, I won't be able to run the app on a real phone. I will have to finish the development on an android simulator by running
expo start --dev-client
and pressa
to open the app on the android emulator.then add the code to display the ads.
Once it's done, run
eas build --platform android
to create a buildfollow the long process to upload my first build to the Play Console
Publish it as a beta app, send the link to adMob review.
Once adMob says all's good, I can publish the app for good on the PlayStore.
It's not a smooth process... I don't know why Expo decided to remove such a common package! Can someone confirm to me this is the right process? Or maybe there is a simpler approach, with a different library?