evollu / evollu/react-native-fcm
Notification listeners don't fire when Android app is Paused
- Dominant language
- Java
- Stars
- 1.7k
- Forks
- 661
- PR merge metrics
- No merged PRs in 30d
Description
Before openning an issue
1. Reproduce it with the example project in this repo.
2. If you can't receive iOS notification, make sure you can receive notification using quickstart-ios project provided by Firebase team
When openning an issue, please include following information for better support
1. What version of RN and react-native-fcm are you running?
RN 0.53.3, react-native-fcm 13.3.3
2. What device are you using? (e.g iOS9 emulator, Android 6 device)?
Android 8.0 device
3. Is your app running in foreground, background or not running?
I'll try to explain with the Application Lifecycle in mind: https://i.imgur.com/BX5D4Bi.png
I have three listeners:
1. One `FCM.on` listener within the React component class definition (in `componentDidMount`), which fires when a new notification arrives when the user has the app in the foreground
2. One `FCM.on` listener outside the React component, which is exactly copied from the `Usage` section, i.e. to finish a notification on iOS
3. One `FCM.getInitialNotification` method which is in the `componentDidMount` method and serves to provide notifications when the app is opened from tray.
I expect this behaviour:
1. A notification triggers an event listener when it is in the foreground (this works)
2. A notification triggers an event listener when the app is opened from not being active (i.e. when it is killed or stopped in Application Lifecycle language, this works and it shows a clear distinction between started from the menu vs started from a notification)
3. A notification triggers an event listener when the app was recently closed, i.e. when it is paused in Application Lifecycle language. This does not happen! None of the event listeners is triggered when, for example, I close the app (e.g. by tapping the home button) if shortly after (e.g. a few seconds after) a notification arrives & I tap the notification.
I wonder whether my no.3 expectation is supported by `react-native-fcm` or whether it is unrealistic, or whether this is something that should have worked.
Please let me know, thanks a lot!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.