-
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
Notification not more received in IOS after the App close #2192
Comments
Notification stuff is notoriously complicated. I'd have to see reproducible example in a repo on github |
Yes, I totally understand that it's complicated. FOUR weird things,
|
Hello 👋, to help manage issues we automatically close stale issues.
|
I have the same issue on version 5.3.1. |
@timhonders, I solved most of the problem by always conduct a request permission call before register a series of notification listeners. It’s mentioned in documents but not that obvious. Especially in my case, I don’t want to prompt user at the very first time the app is open, but rather until it comes to a special point. I think we need some real life working example in a more comprehensive way in the context of react native. Current documents provide just separated snippets which is not very clear and helpful to people new to this tool. |
I completely agree we need an example - I've started with https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh and I'd love for the App.js there to have the ability to show scenarios in an easy way. I will happily accept pull requests there and add collaborators, and as I maintain the v5 branch I'll keep it up to date, but I haven't had time to implement feature demos yet - just building was hard enough! |
@Nerogee I found an other workaround you could call firebase.messaging().ios.registerForRemoteNotifications(). This wil fix the issue without the need to call requestPermission. I will go with youre fix, thnx |
Can confirm that I do not receive notifications on ios with the app in the background, and additionally, that I getAPNSToken returns null (not the FCM token though), unless I call |
Hello 👋, to help manage issues we automatically close stale issues.
|
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. |
Working for me... tks.... |
#1203 (comment) worked for me |
Issue
I managed to generate fcm token and pushing notification while my iphone device can receive successfully. In my app, I always perform firebase.messaging().deleteToken() and firebase.messaging.getToken() each time a user login or when a user changes his profile setting whether to receive notification or not (this is the app logic). And this behavior works fine, each time I login, I get a new fcm token and save it in my database. The token is working fine. The problem happens when I close my app and reopen it again. though I can still get a new fcm token after perform a login, that token is not working. By not working, I mean when I test the new token through postman, I get successful response, but my iphone device does not receive anything. That is weird.
However, if I turn off the device notification permission in IOS system settings, then go back to my app and toggle the notification setting in user profile which will in return check permission again. In the permission popup, I implement a button that redirects a user to IOS notification settings. Once I turn on the permission in device setting and back to my app to let it generate a new fcm token. It works again.
does any solution or explanation to this issue? I found some people said the notification stop working after some time. Is it the same issue here?
P.S. In Android, it works fine.
Project Files
iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:Android
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 -->
Environment
Click To Expand
react-native info
output:Firebase
module(s) you're using that has the issue:e.g. Instance ID
TypeScript
?Y/N
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
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: