-
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
Android: getInitialNotification/onNotificationOpenedApp not triggered for old notifications if app restarts #4052
Comments
I'm also experiencing this bug on Android, on iOS it is working as expected. I've upgraded to the latest version and it's still an issue. Does anyone have an idea on how to debug this? |
I did some digging in ie null here: Line 71 in ff768fc
|
@Wedin common cause, a splash screen intercepting (and not passing along) the Intent required to ferry the data through. react-native-splash-screen is a known failing, unmaintained culprit. react-native-boot-splash is a maintained package that works. You're piggy-backing on someone else's issue, so you haven't posted the information we request for troubleshooting, meaning this is just a guess |
Yeah sorry, let me add some more info! It's not related to any other package as far as I can see, as this can be reproduced in a clean react-native project with only react-native-firebase as deps. I've verified this here: https://github.com/Wedin/test-react-native-firebase-messaging. Dependencies
|
I believe I am having the same issue. I haven't installed any RN splash screen modules in my project. Easiest way for me to reproduce is by receiving a notification, opening app normally, close app, tap notification and see that |
Yep, i have encountered the same issue at Android app, iOS app is working as expected, any solution for that? @Wedin @alexwasner ? Step to reproduced: As as know, ReactNativeFirebaseMessagingReceiver.notifications array will be keep all remote messages, but when we kill application from recent menu app, this array will be free because app process died. |
@vannt1991 there is no one I'm aware of (community or Invertase) working on this at the moment. I'm not sure what a solution would look like but if the app goes away then I assume there will need to be some sort of storage used instead of an in-memory array. Thinking about that practically, are there any patterns to follow in the current codebase where the library uses app-local storage already? (prefs, async-storage, something else?) Because if there is an existing pattern, then I would just re-use that to store information allowing for old notifications to be handled well. If there is not, then it seems a small JSON in the app cache dir that is stored with current notification information whenever they come in, with notifications removed as they are handled/cleared would do the trick |
@mikehardy Thanks 👍 Yep, Pls do that assap, this issue is very common case and easy to reproduced with user. What we need todo: Thanks for your effort 👍 |
I will not do this. You, or someone else will do this - for the avoidance of doubt. No one is working on this currently (not me), and we are waiting for a PR. Someone here needs to propose a PR |
#4203 |
Patch-package format patch bundle available here for the PR! https://github.com/invertase/react-native-firebase/suites/1137916996/artifacts/16295093 any independent confirmation that it works for you or not is very helpful 🙏😁 |
I've tested the patch-package and I can no longer reproduce the issue 👍 |
Excellent! Thank you for testing that - it helps a lot I've reviewed the PR and it needs a little bit of work to be ready but I believe the style in general of the PR can work. The problem you will experience is that the PR is persisting notification information in your app preferences area, which is great in order to reference them across restarts but there is no cleaning function so there may be unbounded growth in storage space consumed by preferences. I have proposed a solution to that deficiency and I/we are waiting on response from @vannt1991 |
Issue
Before i was using firebase 5+ and everything was working just fine. But few months ago i updated firebase to 7.0.1 (it was latest version) and over time users have started to report issues that they can't open specific page from push notification. After investigation i found steps to reproduce this bug, here it is:
It looks like they become expired or something, since you already opened app from another notification. Can that be possible ?
I'll update issue with code snippets if necessary, but seems like the problem is not in the code.
Versions:
"react-native": "0.61.2",
"@react-native-firebase/messaging": "^7.0.1",
"@react-native-firebase/app": "^7.0.1",
The text was updated successfully, but these errors were encountered: