-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
onMessageRecieved not working when app is killed. Any solution? #822
Comments
This issue does not seem to follow the issue template. Make sure you provide all the required information. |
@KORuL thank you for reading all of those other issues. It may very well be that Meizu has device-specific behavior changes which break FCM. Does this happen for you on other manufacturer's devices like Samsung or Google? @kroikie do you think there is anything different going on here versus the other issues? |
This does not happen with Google and Samsung devices. |
Hello, |
I get the same problem on a Tecno Spark:
Even worse is how, the app is in the "Recent Apps" list, but still doesn't get any push messages when it gets into Doze. Please note I'm using FCM High Priority Messages and I'm sending a I tried out other push notification services on the same device and I noticed one of the services, does restart it's notification listening service even when a user kills the App:
Q) Is it possible to have such an implementation on FCM, regardless of the device? |
@EdwardQuixote just FYI the "pushy" service does not use FCM it uses its own MQTT-based push notification service so it has totally different properties. |
@samtstern Thank you, I will look at this library! It’s a pity that @google @samtstern doesn’t want to do anything with an obvious BAG, which has been preventing us from developing good applications for more than 2 years! |
@samtstern Yes it uses MQTT. I just thought maybe Google could give us something like it even if FCM uses different protocols. |
@EdwardQuixote that's a reasonable thing to ask, I was just saying that there's no need for us to do something like "restart the service" since FCM messages are received by Google Play services and not your app itself. When you use something like Pushy then each app is going to keep its own connection open. So that's where the different behavior comes from. If every app on your phone had an MQTT connection open in the background your battery would be very unhappy :-) |
@samtstern Why, then, Google will not fix this bug? Accepts push with google service and redirects the receiver in the application. It's good if all the push messages are handled by one service in the system, and only it keeps one connection for all. And yes, if each application opens the connection it will be bad. But what to do in this situation? Push is required when the application is closed! |
It's bizarre. It works correctly android eight on a real device, and Android nine on a simulator, however, doesn't work on an actual device with android six unless it works on background. When the app killed by the user, doesn't receive messages. |
Got the same issue on Nokia TA-1000 OS 9.0 with W/GCM: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg="app-pkg-name" (has extras) } Also failed on SAMSUNG-G9300 (8.0.0) with an extra info : W/GCM: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10000000 pkg="app-pkg-name" (has extras) } However, it succeeded on Nexus 6P (OS 8.0), receiving the msg instantly. You could also check out this thread. |
i believe this has nothing to do with FCM, it is a service at the end of the day and you need to look on how to maintain a service from being killed by the OS and you will find a lot by googling on this. |
I was able to solve the problem. In our app we are displaying a splash screen (SplashActivity.java) before the app starts. Here how it looks like:
|
Not the problem |
I heard that for some there is a solution with adding an application to autostart, but this requires actions from the user, maybe there is some kind of flag in the manifest? |
Yes,I am 100% sure it's auto start related issue. I have cross verify with manual on auto start permission. It's seems fine. Have you any solution for this? |
FYI. About granting auto start permission, there is a library trying to make it for all the non-stock android phones. |
Meizu M5 |
Does anyone found the solution? I've Android device and I receive the push message only if ap is in the background but not killed. Android 8.0.0 |
Is there any solution found? issue happens in samsung galaxy mobiles too |
I have the same issue. Somewhat.
Logcat (app kill):
Logcat (message delivery):
But: |
when I am publishing message in firebase, the notification message displaying in Andriod Studio logcat. But the same notification is displayed in the emulator. I am using Andriod 9.0. |
I also can't receive notification in System Notification Bar when App is killed by swiping remove Unless the app is set to run in the background and can start automatically in the system settings (default is auto managed by System).
|
Same issue on Samsung Galaxy A5 with Android 8.0.0. implementation 'com.google.firebase:firebase-messaging:20.2.0' |
ahhh... found this on SO - https://stackoverflow.com/questions/48642423/firebase-push-notification-issue-in-android-when-app-is-closed-killed |
There is nothing actionable in this thread related to the Android quickstart; this isn't the correct place to troubleshoot message delivery issues. |
Step 1: Describe your environment
com.google.gms:google-services:4.2.0
Step 2: Describe the problem:
Almost all phones are fine. But in some phone (Meizu M1 note):
onMessageRecieved not working when app is killed in some devices. It works perfect in foreground and in background. But when app is killed I don t receive notification in system tray, or call onMessageRecieved .
I send only DATA (to, data) notification. What I do wrong?
I read #4 , #89 , #86 , #368 , #365 , #337 , #205 , #96 , #20 , #4, #151 , #816 did not find the answer.
I get a strange error in logcat
W/GCM: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=net.korul.hbbft (has extras) }
I made this receiver - but it did not help
AndroidManifest contains:
MyFirebaseMessagingService - is standart from snippset
Steps to reproduce:
Observed Results:
W/GCM: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=net.korul.hbbft (has extras) }
Expected Results:
Should get the notification
Relevant Code:
I read all the branches dedicated to this issue, do not refer to them! The problem is, she is over 2 years old! Need a solution!
I also tried to send a push message with the firebase console, and it does not come - the exact same error
The text was updated successfully, but these errors were encountered: