React-native-firebase: 馃敟馃敟馃敟Push notifications are never received on iOS 13

Created on 11 Sep 2019  路  5Comments  路  Source: invertase/react-native-firebase

Issue

Hello, I've been using rn-firebase for about a year now, has been and still is working fine on iOS 11-12. But now on 13, things are very different. When I send a push notification from the Firebase Cloud Messaging Console, the phone doesn't register it as such. When running in foreground, it instead receives a data-only message that contains the PN's custom key/value pairs but not the PN's text message itself. That hasn't happened before (to the contrary, data-only wasn't working at all!). When running in background, nothing happens, and I will receive the same data-only message upon bringing it back to the foreground. When not running at all, nothing happens and the app will never know.

Considering that iOS 13 will be officially released next week, I would consider it pretty problematic that confirmed working apps will stop functioning as expected overnight. What are we supposed to do about it?

iOS

Click To Expand

#### `ios/Podfile`: - [x] I'm not using Pods - [ ] I'm using Pods and my Podfile looks like:

# N/A
#### `AppDelegate.m`:
#import "AppDelegate.h"
#import <Firebase.h>
#import "RNFirebaseNotifications.h"
#import "RNFirebaseMessaging.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <RNCPushNotificationIOS.h>
#import "RCCManager.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  //Firebase setup
  [FIRApp configure];
  [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
  [RNFirebaseNotifications configure];

//...
//other stuff
//...
}

Environment

Click To Expand

**`react-native info` output:**

 React Native Environment Info:
    System:
      OS: macOS 10.14.6
      CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
      Memory: 208.12 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.15.0 - /usr/local/bin/node
      Yarn: 1.9.2 - /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.4, macOS 10.14, tvOS 12.4, watchOS 5.3
      Android SDK:
        API Levels: 21, 22, 23, 24, 25, 26, 28
        Build Tools: 23.0.1, 23.0.3, 25.0.0, 25.0.1, 25.0.2, 26.0.0, 26.0.1, 26.0.2, 28.0.3
        System Images: android-24 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5199772
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.6.0-alpha.8af6728 => 16.6.3 
      react-native: ^0.59.3 => 0.59.3 
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1
- **Platform that you're experiencing the issue on**: - [x] iOS - [ ] Android - [x] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - 5.3.1 - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `N`

Most helpful comment

Hmm - what's problematic for me as a report is that these versions are all seem pretty old (I don't see your Firebase iOS SDK versions? but with react-native-firebase at 5.3.1 and react-native 0.59 the SDKs must be old). As a maintainer in other repos scrambling to prepare for iOS 13 I can imagine that if there was an adjustment to be made, it would have been in the releases after the versions you have.

I'll check iOS13 when I have time (should be this week?) but I wouldn't count on it - I would strongly advocate moving to react-native-firebase 5.5.6 and iOS Pods 6.8.0 (current as of today, both). You can do this with react-native 0.59.10 (so you don't have to eat the time-cost of going to 0.60.5 there) but there are breaking changes for react-native-firebase 5.4.x -> 5.5.x so pay attention to the release notes there. Not too difficult and for valid iOS13 testing it should be worth the trouble for you?

All 5 comments

Thanks for the report. We need to investigate iOS 13 support, however I don't think that will be in time for the official release. If someone can provide help on this we'll be very grateful.

Hmm - what's problematic for me as a report is that these versions are all seem pretty old (I don't see your Firebase iOS SDK versions? but with react-native-firebase at 5.3.1 and react-native 0.59 the SDKs must be old). As a maintainer in other repos scrambling to prepare for iOS 13 I can imagine that if there was an adjustment to be made, it would have been in the releases after the versions you have.

I'll check iOS13 when I have time (should be this week?) but I wouldn't count on it - I would strongly advocate moving to react-native-firebase 5.5.6 and iOS Pods 6.8.0 (current as of today, both). You can do this with react-native 0.59.10 (so you don't have to eat the time-cost of going to 0.60.5 there) but there are breaking changes for react-native-firebase 5.4.x -> 5.5.x so pay attention to the release notes there. Not too difficult and for valid iOS13 testing it should be worth the trouble for you?

That combination of versions has done the trick, thank you for the fast and helpful reply! To my defense, I've been trying with various combinations of versions before for a while and faced all kinds of other cryptic issues. The documentation is vague at times, and the Firebase SDK itself is tricky to deal with outside of Cocoapods (which I'm not using because it breaks other things in my project). Life tends to be not easy right in the middle between Apple, Google and Facebook. cough

Great - glad that worked for you. And yes, handling 3 ecosystems is pretty challenging. I have reasonable luck on the most current of the various releases but I also usually end up with a patch-package patch to make one version of something work. In your case if you are not using pods may I infer you have swift dependencies and need to do the use_frameworks thing? You will probably like react-native 0.61 if that's the case - I believe they finally ironed all that stuff out

With RNFirebase 5.5.0 and ios POD 6.8.0 still does not work. Even with 6.8.0 it show the FIRApp not configured. Any solution I tried different other version but no luck. Everything works fine in Android.

Im running RN 59

Was this page helpful?
0 / 5 - 0 ratings