react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

[iOS] notification action does nothing if app is killed

Open blankg opened this issue 7 years ago • 12 comments

Issue


In iOS if you kill the app and then click on a notification action the notification action is not delivered to the JS side since JS bridge is not ready yet. Enabling the commented PRE-BRIDGE-EVENTS code in RNFirebaseNotifications seems to resolve the issue. Can this code be enabled to resolve this issue? if risky perhaps put it behind a flag that can be configured.

Project Files

iOS

ios/Podfile:

  • [ ] I'm not using Pods
  • [x] I'm using Pods and my Podfile looks like:
# N/A

RNFirebaseNotifications.m:

// N/A


Environment

  • 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
  • If known, the version of the platform are you experiencing the issue on:
    • ADD_SOMETHING_HERE e.g. iOS 10 or Android API 28
  • Operating System:
    • [ ] MacOS, version: N/A
    • [ ] Windows, version: N/A
    • [ ] Other, please specify: N/A
  • Build Tools:
    • ADD_SOMETHING_HERE e.g. Xcode 10, Android Studio 3.2
  • React Native version:
    • ADD_SOMETHING_HERE
  • React Native Firebase library version:
    • ADD_SOMETHING_HERE
  • Firebase module(s) you're using that has the issue:
    • [x] N/A
    • [ ] Authentication
    • [ ] Analytics
    • [ ] Cloud Firestore
    • [ ] Cloud Messaging (FCM)
    • [ ] Crashlytics
    • [ ] Dynamic Links
    • [ ] Functions Callable
    • [ ] Invites
    • [ ] Instance ID
    • [ x] Notifications
    • [ ] Performance Monitoring
    • [ ] Realtime Database
    • [ ] Remote Config
    • [ ] Storage
  • Are you using TypeScript?
    • [ ] No
    • [ ] Yes, version: N/A
  • Are you using Expo, e.g. ExpoKit?
    • [x] No
    • [ ] Yes, I've not ejected
    • [ ] Yes, but I have ejected to ExpoKit
    • [ ] Yes, but I have ejected to vanilla React Native
    • Expo version: N/A

Think react-native-firebase is great? Please consider supporting the project with any of the below:

blankg avatar Dec 25 '18 10:12 blankg

Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 22 '19 14:01 stale[bot]

same me, when app killed, if i click to open app from notification, app crashed. how to debug remote notification if app killed with real device?

phonganhhung9xtb avatar Jan 22 '19 17:01 phonganhhung9xtb

Even with commented out // PRE-BRIDGE-EVENTS the app still opens and crashes on a notification click.

gregtap avatar Feb 06 '19 10:02 gregtap

I have reproduced this issue on iOS but I am not experiencing it with Android.

Does anyone have any tips on tools to debug this? I'm not sure how to get the stack trace on iOS...

vpontis avatar Feb 08 '19 23:02 vpontis

In my case it was expokit SDK32 related, fix is here -> https://github.com/expo/expo/pull/3431/files

gregtap avatar Feb 09 '19 06:02 gregtap

@coulix that looks like my issue! Were you able to upgrade Expokit and fix it? What version of Expokit are you on?

vpontis avatar Feb 09 '19 22:02 vpontis

Fixed it!

https://github.com/expo/expo/pull/3431#issuecomment-462086795

vpontis avatar Feb 09 '19 22:02 vpontis

Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 09 '19 23:03 stale[bot]

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.

stale[bot] avatar Apr 06 '19 23:04 stale[bot]

Hi @blankg , I have the exact same issue as you. I applied the same workaround you described with no success. I use react-native-firebase 4.2.0.

Did you made another changes to resolve this issue ? Thank you in advance.

zarvedan avatar Aug 28 '19 15:08 zarvedan

@zarvedan , I used it with 5.1.1 so that could be the issue. You can checkout the version we use from our fork https://github.com/capriza/react-native-firebase

blankg avatar Aug 29 '19 18:08 blankg

@blankg I did a fresh install with react-native-firebase: 5.2.1 and your workaround and I confirm that it works. Many thanks for your help, it was hard to find a solution to my issue.

@salakar In my case, it was an iOS issue, not Expo.

zarvedan avatar Sep 02 '19 13:09 zarvedan