-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔥 Can AdMob be an optional 'dormant' part of a white-label app? #4073
Comments
Have you tried simply using the Google sample AdMob ids? https://github.com/mikehardy/rnfbdemo/blob/eda24a71990e95e8a91b17b27b0cc1417031808b/make-demo.sh#L122 That said, you may run in to other problems with your clients if they intend to publish iOS apps marketed for children: #4021 meaning you may need to have two separate builds completely, one of which follows whatever the resolution of #4021 is (likely be not including the |
There's no way as far as I know to have no ids, the underlying AdMob sdks expect these and will crash your app on start if not found unfortunately. You could deploy using the sample ids as Mike suggested above, but should also note the suggestion if your iOS app is marketed for children. |
Thanks both. I wasn't sure if there were any side effects to having the sample AdMob IDs in the config file for customers who aren't using the AdMob functionality in their app. Do the sample IDs cause any reporting to happen? The children point is an interesting one. Most of our apps don't have this issue, but one definitely does and others could in future, this we'll definitely have to consider this. Is there any possible way you can think of that we could include the AdMob and Analytics libraries conditionally at build time, to avoid us having to maintain parallel branches of our codebase? |
Perhaps. I don't use AdMob (except to demonstrate it works and how to integrate it, as in that script) so I'm not sure.
I'm not aware of any way no but my best advice is to subscribe to those upstream issues, it's an area of current work |
Thanks @mikehardy - do you mean #4021? It looks like that one is closed, is there further work occurring? |
@gavrichards on your side you'll have to build an app without AdMob at all I believe, and you'll have to remove Analytics as well. Should work if you are on firebase-ios-sdk pod 6.27.1 or greater (which is the default now, on current stable react-native-firebase versions), pending confirmation from @pabloearg here #4072 (comment) |
I'm going to close this one out - I think we've provided what info we can. This is as mentioned an area of a lot of interest on the behalf of Apple app reviewers though. You can't have analytics at all if an app targets kids (but it should be possible to pass review now regardless of module as long as it's not analytics and admob: #4134) and you can't have admob without consent, and for that you'll need up to date admob + a react-native-permissions PR applied, per #4107 ) |
Issue
My React Native app is a white-label app which I build and maintain for many customers. It's deployed using Fastlane as part of an automated build and deployment process.
I have built AdMob into my app using this library and it all works great.
My problem is that I need to make AdMob an optional feature of our app for our customers. Some may want to use it in their app, others will not.
In an ideal world, the AdMob app IDs would be fed into the app via an API call at app runtime, but from what I can gather that's not possible and they must be included in firebase.json at build time. This is acceptable as we can inform our customers that they can only set or change their app IDs when we build and submit their app to the store.
I have included
admob_delay_app_measurement_init: true
in firebase.json as we are using the consent flow.The issue is that if I try to run the app without
admob_ios_app_id
andadmob_android_app_id
present, the app immediately crashes when it runs. Nothing is reported in the console.I've also tried including these parameters but populating them with empty values or "na" but the app still crashes. This suggests that the app is immediately validating these app IDs somehow (with a remote server?) which is surprising considering I have left
admob_delay_app_measurement_init: true
in firebase.json, which I would've expected meant that no AdMob API calls were made until thefirebase.admob().initialize()
method is called.Lastly I have tried removing all three parameters from firebase.json, but the app still crashes immediately.
So is there a way to integrate React Native Firebase AdMob into an app's codebase but have it inactive/dormant? Or am I going to need to have a separate branch of my codebase without AdMob in it entirely for those customers who don't wish to use it?
Project Files
Javascript
Click To Expand
package.json
:# N/A
firebase.json
for react-native-firebase v6:iOS
Click To Expand
ios/Podfile
:# N/A
AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:8.3.0
Firebase
module(s) you're using that has the issue:AdMob
TypeScript
?N
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: