Describe your issue here
Hi, i found bug, admob banner not show, and event not start. it's work on previous version of firebase 5.4.3. I testing on android and it's work but ios simulator or real device not show banner.
Click To Expand
#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'radiosreunion' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for radiosreunion
pod 'Firebase/Core', '~> 6.2.0'
pod 'Firebase/AdMob', '~> 6.2.0'
pod 'GoogleIDFASupport', '~> 3.14.0'
pod 'Firebase/Database', '~> 6.2.0'
end
#### `AppDelegate.m`:
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <Firebase.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FIRApp configure];
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"radiosreunion"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
@end
Click To Expand
#### `android/build.gradle`:
// N/A
#### `android/app/build.gradle`:
// N/A
#### `android/settings.gradle`:
// N/A
#### `MainApplication.java`:
// N/A
#### `AndroidManifest.xml`:
<!-- N/A -->
Click To Expand
**`react-native info` output:**
React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 48.07 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.3 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 26, 27, 28
Build Tools: 27.0.3, 28.0.2, 28.0.3
System Images: android-23 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5314842
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.9 => 0.59.9
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
- **Platform that you're experiencing the issue on**:
- [x] iOS
- [] Android
- [ ] **iOS** but have not tested behavior on Android
- [ ] **Android** but have not tested behavior on iOS
- [ ] Both
- **`Firebase` module(s) you're using that has the issue:**
- `ADMOB`
- **Are you using `TypeScript`?**
- `No`
Think react-native-firebase
is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]
React Native Firebase
and Invertase
on Twitter for updates on the library.You didn鈥檛 follow the template, so I鈥檓 unclear how you have it installed. I鈥檓 currently diagnosing an AdMob issue with react-native-firebase 5.5.x on iOS but it鈥檚 related to header files and admob not even being found in https://github.com/mikehardy/rnfbdemo where I test the builds.
Please update this issue with the full template indicating how you integrated with ios or I鈥檒l have to close as it won鈥檛 be reproducible
Same error here, works perfect on Android but not work on iOS
v5.5.3
Interesting. @GH974 you mention it was working on firebase 5.4.3, one of the things you potentially did was alter the underlying Firebase iOS SDK Pods. Can you publish if there were any differences between your podfiles between the two versions?
Also I believe you needed to add something to your plist for iOS for the new AdMob SDKs - they required https://rnfirebase.io/docs/v5.x.x/admob/ios#Update-your-plist-file
@farad4y did you ever have it working? Helping us see exactly when it was working last, and when it stopped working, will let us see what the total changes were between the two then we can maybe isolate
Hi, yes i was added in info plist the admob setting
@mikehardy After @GH974 's issue i downgraded version 5.4.3 now AdMob works on iOS
To fix this problem, is there anything that i can share ?
Pods
pod 'Firebase/Core', '~> 5.20.2'
pod 'Firebase/Messaging', '~> 5.20.2'
pod 'Firebase/AdMob', '~> 5.20.2'
pod 'Fabric', '~> 1.10.1'
pod 'Crashlytics', '~> 3.13.1'
That's useful - thank you both. @farad4y - to be very specific - it sounds like your Podfile stayed the exact same, with those versions (5.20.2) and AdMob works with RNFB at 5.4.3, but does not work with RNFB 5.5.x?
So the only change is RNFB moving from 5.4.3 to 5.5.x?
I can start hunting through the changes if that's the case, the changes are tiny between each of these versions mentioned
Yes, I have installed v5.5.3 and configured Podfile by using the latest document. I am currently using v5.4.3 and the Podfile is as I have shared above. I didn't make any other changes. Works on v5.4.3
So if that鈥檚 the case, then the change is in here somewhere: https://github.com/invertase/react-native-firebase/compare/v5.4.3...v5.x.x
There is not that much there - note that a lot of it is in the /tests/ directory.
None of it seems related to me. Except maybe some part of AdMob was relying on invites (which is removed)? Maybe you can try pods 6.3.0? Maybe you could add the GoogleIDFASupport pod (version 3.14.0 is the latest - this is just trying anything though, I don鈥檛 know if it will help.
Definitely running it on simulator and watching the log via Xcode if at all possible to see if something is going on there.
@Salakar @Ehesp sorry to ping you on this but I don鈥檛 use AdMob so I鈥檓 not familiar. Sounds like a pretty narrow range here to look at though if you guys have any time to investigate. I have re-integrated AdMob into the react-native-firebase/tests/ iOS app for v5.x.x so there鈥檚 a base on which to work, if you guys are fast at driving the test rig it might be easy to check AdMob banner loading?
I can't get 5.4.3 or 5.5.4 to work on iOS at all. The analytics seems to work fine, but the ad component just doesn't show.
Nothing logs in either of the following callbacks either:
<Banner
unitId={unitId}
size="SMART_BANNER"
request={request.build()}
onAdLoaded={() => {
console.log('Advert loaded')
}}
onAdFailedToLoad={() => {
console.log('Advert failed to load!!!!')
}}
/>
I just pulled down the starter app, uncommented the admob pod, installed, ran the app and get the following:
You attempted to use a firebase module that's not installed natively on your iOS project by calling firebase.admob().
Ensure you have the required Firebase iOS SDK pod for this module included in your Podfile, in this instance confirm you've added "pod 'Firebase/AdMob'" to your Podfile
See http://invertase.link/ios for full setup instructions.
Error: You attempted to use a firebase module that's not installed natively on your iOS project by calling firebase.admob().Ensure you have the required Firebase iOS SDK pod for this module included in your Podfile, in this instance confirm you've added "pod 'Firebase/AdMob'" to your Podfile
@mikehardy I realized that Framework Search Path on XCode is wrong for Admob. Although i fixed, not works. Maybe I miss something but there might be some another linking problem.
I am unfortunately certain that AdMob has something wrong with regard to search paths etc, but I have not had the time to learn enough about Pods (they are fairly new to me) to figure out the problem. any help appreciated
i faced this problem too... any solution?
@nyl9488 use latest version and update your project RN 0.60+
Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
This shouldn't be closed. I'm still experiencing this issue as well. Ads show with real unit id in debug install, doesn't show on release install. I even set up alerts to show onAdLoaded
and onAdFailedToLoad
. Alerts show on debug, not on release. Not sure how to track down where the issue is happening.
RN 0.59.8
RNFirebase ^5.5.6
pod 'Firebase/Core', '~> 6.3.0'
pod 'Firebase/AdMob', '~> 6.3.0'
@pianoman730 if it is possible for you, upgrade react native 0.60+
in new version you will link with Pod, it will work like a charm. I use latest version. There is no problem.
I second that - although we have Admob working with rn59 now as well - since this discussion I developed two demonstrators to show it (and help us fix the problem):
https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh
https://github.com/mikehardy/rnfbdemo/blob/master/make-demo-rn59.sh
They show everything working now (but pay close attention to the order they link/pod install on rn59, and pay close attention to RN60 using the branch git dependency now as 5.5.6 has possible android library issues and there's a fix merged already but no 5.5.7 release yet)
So I actually used that script for rn59 and followed it exactly to get everything working. It was actually very helpful. I'm just not seeing actual ads or any activity from that component at all on Release version on iOS.
Oh dang - well, glad the script helped but sorry to hear it didn't resolve it for you. I don't personally use ads so I can't help further but perhaps if you can make the jump to rn60 it will resolve as @farad4y mentions.
So upgrade to rn60 and that's it? Don't need to update any versions of firebase?
Well, I want to be clear we are guessing here - it may fix it but I can't be sure, there is just a report from a comment above that it works for someone on RN60. Your negative results currently may be something unrelated and we all may be about to learn (after much investigation) that there is some separate problem, because RN60 doesn't fix it for you
version-wise - well, always best to stay current? The iOS SDK Pods are on 6.7.0 right now
RNFBv5 is on 5.5.6 right now so no need to move forward on that yet, though you may need this #2476 gradle/AndroidX patch until we can release 5.5.7 - here is it for patch-package usage (with extension '.txt' added so github will allow me to attach it):
react-native-firebase+5.5.6.patch.txt
@pianoman730 follow latest instructions, I upgraded firebase too.
I just kind of feel like it's overkill to update everything just to get ads working iOS. They show when I install a debug version, just not a release version. I don't even get the methods for onAdLoaded
to fire on release. Were ads not ever working on iOS?
I believe ads were working yes - I think they are vital to lots of people based on the bugs logged against them. I believe debug vs release problems are usually integration issues, the release target not being done correctly in plist or not being linked correctly etc. RN60 conversion usually clears that out because all the linking goes away and pods either blows up completely or works (in my experience), and usually works...but I hear you. It does seem like overkill. There is some underlying reason it isn't working for you I just don't know what
Not working for me either.
Started from a fresh new app using RN 0.60.5.
Using latest version RNFirebase ^5.5.6
We have reports of it working on rnfb 5.4.3, then breaking for all further versions. We have reports of it not working on rnfb 5.4.3. Honestly, it has definitely worked for people but the information that has come through on this thread doesn't point to any one problem reliably. Someone is going to have to do a thorough investigation to isolate it. I don't use admods personally so I can't help, sorry
i just tried downgrading to RNFirebase 5.4.3 and it just doesn't show up. I don't think I'm doing anything wrong.
My podfile contains :
pod 'Firebase/AdMob', '~> 6.3.0'
pod 'Firebase/Core', '~> 6.3.0'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
My AppDelegate.m is correctly configured.
I don't know if the next version of Firebase will include some fix. It's kind of weird because there isn't too much people complaining about this issue.
Unfortunately @Daavidaviid that isn't quite enough information as I'm not sure of other versions (which react-native?), also, pods 6.3.0 are not compatible with RNFB5.4.x as far as I know? Plus pods are actually on 6.7.0 now (plus a fix for firestore after 6.7.0 even)... and you are right, not that many are complaining which gives me a feeling that it is something project specific. What though? No idea
Is there a reliable list of the dependencies for rn 60? The changes needed for firebase on rn 60 from rn 59?
You can see the differences in resulting projects for both
https://github.com/invertase/react-native-firebase/issues/2280#issuecomment-524379360
For me, it's the same RNFB code, and the same firebase sdks running for either. They are simply referenced differently (via auto-linking for native code, and by cocoapods strictly for iOS native code). It's that switch to pure cocoapods setup which has potential to solve issues because getting Xcode configured correctly is a source of much project-specific error.
Hi, i re tested, and it work, but if i want to add pod 'GoogleIDFASupport', '~> 3.14.0', admob not work
Hi, i re tested, and it work, but if i want to add pod 'GoogleIDFASupport', '~> 3.14.0', admob not work
Well, I'm surprised because I keep trying and it never shows up on my screen..
I even tried adding some RCTLog in the admob RNFirebaseAdMob.m
files and there are not showing up..
I think it's the #if __has_include(<GoogleMobileAds/GADMobileAds.h>)
that's failing.
On the other hand, the RCTLogs show up in the - (id)init
method in the RNFirebase.m
file.
I added pod 'Google-Mobile-Ads-SDK'
in my Podfile, but still no luck..
I'm gonna pursue my investigations, I'll keep you updated.
My versions are :
Ok, I got it to work the issue was on my part (sorry about that).
So basically I'm using :
And I added this to my Podfile (as mentioned in the doc) :
pod 'Firebase/AdMob', '~> 6.3.0'
I thought I did this previously, I guess I f*cked up..
Anyway, thanks for helping me.
After much struggling and pain with dependencies, I successfully upgraded to RN60 and ads now function as expected on iOS.
Really glad to hear that worked for you! Sorry that it took an upgrade to RN60 to do it - I know that RN59->RN60 migration was painful. On the plus side - auto-linking + cocoapods will make managing the native projects so much easier for you going forward. Cheers
Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
Following the last comment of @Daavidaviid, it did not worked for me.
Adding pod 'Firebase/AdMob', '~> 6.3.0'
gives:
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In snapshot (Podfile.lock):
Firebase/CoreOnly (= 6.9.0)
In Podfile:
Firebase/AdMob (~> 6.3.0) was resolved to 6.3.0, which depends on
Firebase/CoreOnly (= 6.3.0)
RNFirebase (from `../node_modules/react-native-firebase/ios`) was resolved to 5.5.6, which depends on
Firebase/Core was resolved to 6.9.0, which depends on
Firebase/CoreOnly (= 6.9.0)
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* changed the constraints of dependency `Firebase/CoreOnly` inside your development pod `RNFirebase`.
You should run `pod update Firebase/CoreOnly` to apply changes you've made.
... and running pod repo update
nothing happens.
"react-native": "0.60.5",
"react-native-firebase": "^5.5.6",
@rochapablo you have a different issue. Not sure why your cocoapods repo isn't updating, but that's your root cause. Maybe go into $HOME/.cocoapods and run a git pull origin master or similar, to force it.
Anyway... I did create a new project just including the banner and it still not showing.
pod 'Firebase/Core', '~> 6.3.0'
pod update && pod install
npm run ios
[UPDATE]
Wait!!! I forgot to add pod 'Firebase/AdMob', '~> 6.3.0'
, testing again...
[UPDATE]
pod 'Firebase/Core', '~> 6.3.0'
pod 'Firebase/AdMob', '~> 6.3.0'
Yep! still not working
[UPDATE]
Since I'm not using AdMob, I did not put GADApplicationIdentifier
into the Info.plist
I never use it. But I tried to add just so see what happens and it did work. Not satisfied I changed GADApplicationIdentifier
to GADIsAdManagerApp
(https://developers.google.com/ad-manager/mobile-ads-sdk/ios/quick-start#update_your_infoplist) and also worked.
Now, I'm going to my original project test this.
"react-native": "0.61.2",
"react-native-firebase": "^5.5.6"
Use pods 6.9.0 - current - no reason not to right? If you don't and you end up using Crashlytics you'll be open to App Store rejections because until 6.8.1 at least they included deprecated UIWebView symbols
Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
In my case the app (in iOS) not showing any error, even in console (metro bundler) but the app always get closed after the splash screen. how can I fix this ?
Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.
For me, the issue was a conflict between Modal
and showing Ads on iOS.
Ref: https://github.com/invertase/react-native-firebase/issues/1631
Most helpful comment
This shouldn't be closed. I'm still experiencing this issue as well. Ads show with real unit id in debug install, doesn't show on release install. I even set up alerts to show
onAdLoaded
andonAdFailedToLoad
. Alerts show on debug, not on release. Not sure how to track down where the issue is happening.RN 0.59.8
RNFirebase ^5.5.6
pod 'Firebase/Core', '~> 6.3.0'
pod 'Firebase/AdMob', '~> 6.3.0'