Closed chaitanyadeorukhkar closed 4 years ago
same issue
I have a very similar issue, sometimes notifications just don't work. We are sending data-only notifications.
When this happens firebase.notifications().displayNotification()
doesn't enter neither then
nor catch
EDIT
I've found out that when this is happening the AsyncTask DisplayNotificationTask
is not properly executed. Instead, it is instantiated but its doInBackground
method is never called.
@deorukhkarchaitanya are you listening for fcm registration token changes and updating your backend with the devices new token when it changes, I'd imagine if you're not then the issue probably is that you're pushing to an old registration token.
@Salakar yes, I am listening to the token changes. The token remains unchanged, once I re-open the app and it goes in the background after a while it stops receiving notifications.
For Xiaomi devices turning on "auto-start" fixed this problem. Weird enough, apps like Facebook and Whatsapp have "auto-start" as on by default.
For an Android Go device, I tried whitelisting the app but still no luck.
I suspect this is OEM specific issue but there needs to be some way to deliver these notifications.
Any news on this?
I have the same issue.
I am also having the same issue in android mobiles which having android version 7 and above. Below version 7 it is working fine. Any solution?
Any updates?
Hello π, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.
This issue should not close yet
Hello π, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.
Hello π, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.
Hello π, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.
Same issue here!
Hello π, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.
I'm also having the same issue, background messages works until it doesn't. Each time the app is opened, it starts working for a while again.
Hello π, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.
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.
Still getting issue
i'm also getting this issue on Xiaomi and realme devices
Those vendors have corrupted the Android ecosystem by mis-implementing the power management APIs on purpose, complaints should go to them, and I hope with AOSP for Android 12 where the Android team promised to add compatibility checks for the power management APIs into the CTS these vendors are forced to behave. https://dontkillmyapp.com
Also having the same issue, when device stays in background for several days and then notifications stop coming at all. Problem only disappears, if device is terminated and opened again. Have someone figured out any way to overcome this issue?
https://dontkillmyapp.com probably...
@nasirdev74 how did it go when you followed the link I posted above and made sure Realme device wasn't doing power saving? What evidence do you see in the logs as you test this, so we have concrete detailed information to move the issue forward other than a simple "me too" comment?
same issue
same here
Same issue
same issue
this is still happening in 2024
Issue
[Android] I receive remote push notifications without any issues for a while after interacting with the app. When the app stays in the background for some time (about an hour, this time differs from device to device) the device stops receiving any push notifications. Once I open the app again, I start receiving push notifications as intended until I put the app in background and not interact with it for some time.
After reading a little on this issue, I figured that a lot of android devices kill off the app and it's services completely. Some Android devices have 'auto-start' turned off by default which prevents the background service to wake up after receiving a notification.
I have also noticed that some apps have an FAQ section on how to troubleshoot device-specific issues to recieve push notifications which includes suggestions like turning off battery optimizations, turning on auto-start, whitelisting app from battery saver, etc.
To understand the problem better, I took 2 approaches to FCM
1) notification + data messages from FCM Payload from server:
In this case I followed https://rnfirebase.io/docs/v5.x.x/notifications/receiving-notifications Notification was generated by the OS and displayed appropriately
2) data only from FCM
In this case I followed https://rnfirebase.io/docs/v5.x.x/messaging/receiving-messages Once bgMessaging.js was triggered, I would create a local notification using the data from the payload
Either way, the behaviour remained the same. Devices stopped receiving notifications/fcm messages after a while.
Project Files
iOS
ios/Podfile
:AppDelegate.m
:Android
android/build.gradle
:android/app/build.gradle
:(I have removed a few irrelevant lines and comments)
android/settings.gradle
:MainApplication.java
:AndroidManifest.xml
:Environment
Observed and tested on Android API 25, 27 , 28
10.14.1
N/A
N/A
Android Studio 3.2.1
React Native
version:0.57.7
React Native Firebase
library version:5.1.1
Firebase
module(s) you're using that has the issue:TypeScript
?N/A
ExpoKit
?ExpoKit
N/A
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter