-
Notifications
You must be signed in to change notification settings - Fork 1.9k
I did not recieve any background notifications when app is not running #707
Comments
Have you tried if it does help to set the priority to high when sending the message? Atleast that's required on IOS to wake up an app that isn't running |
@bastian-meier if you force quit the app it won't get the push notification event. I have to write some code to wake up the push plugin if the app is killed. |
@macdonst thanks for your Answer, that would be Nice. But its not my primary Issue. The Problem is not that my app dont recieve the event, the Problem is that my Device wont show the Notification in the "notification area". On my other Devices it works also after i force quit the app or when i reboot the phone. But not on my Huawei Mate7. On this Device the app have to run to recieve the gcm notification |
@bastian-meier okay, that is an odd one. Sadly I don't have a Huawei Mate7 to test on. All of the Android devices I have, Nexus 5, 5X, 6, 6P and OnePlusOne all get the notification in the shade even when the app is forced closed. Obviously, the This seems to be a problem with the Huawei version of Android. What exactly is the Android variant on that device? |
It is the Beta Version for Android 6.0 The Build Number is MT7-L09C432B513 Is there anything i could do to help you? |
I faced same problem that when the app is not running background and foreground (Android), the notification cannot get, anyone has the solution for it? @macdonst , do u mind to share info how to wake up the push plugin if the app is killed? |
+1 @macdonst I using device as follow: Model: Mi 4i Can I know that model of phone that can receive notification when apps is killed (not run in background and foreground)? Or is there any way to wake up the push notification service when the app is not running? |
@jianhao1203 if you look at my earlier comment I've tested this on Nexus 5, 5X, 6, 6P and OnePlusOne. The problem seems to be with Huawei and Xiaomi phones. I'd be interested if they are forking Android and if GCM has problems running on those devices. |
@macdonst I did some testing using WhatsApp for my Xiaomi phone and Lenovo phone. I used Lenovo phone to send message to my Xiaomi phone. Although WhatsApp app is killed off(not running in background) in my Xiaomi phone, however the push notification still can be received in my Xiaomi phone. So I doubt that is it possible for me to modify the code to gather this requirement? One more question is it the following code able to gather the push notification received when app is not running in background? `function onDeviceReady() {
|
@macdonst , I tried to push notification using http://phpfiddle.org/ Is this might be the caused the notification cannot be received when the app is killed off? Any alternative way can send push notification besides this? thanks. |
@macdonst Good news, after I do some research online, I found this post http://stackoverflow.com/questions/30748107/xiaomi-does-not-receive-notification-when-application-is-not-running Anyway, thanks so much for previous comments. =) |
It is working for me now. |
I'm re-opening it so I can add this info to docs. Glad it was resolved for both of you. |
Hi, I've just faced the exact same issue on a Huawei device (honor 7). In order to get it working, you need to go to Settings > Protected apps > check "My App" Applications like whatsapp seems to be "protected" by default, any idea how? |
I also had this problem.. I used mixpanel plugin (from stable branch) and phonegap-plugin-push.. I did not recied any from mixpanel.. because mixpanel json out and phonegap-plugin-push json output are not matched... |
I had the same problem with Huawei P9 lite, found the Protected apps under Battery manager (see http://android.stackexchange.com/questions/152649/what-is-protected-apps-in-huawei-phones). However you can't really communicate this to the end users 😕 |
@bastian-meier How to set priority to 2? Can you share some code. I am facing same problem. |
@bastian-meier @AmitabhWork I have the same problem on P8 lite, still no solution? |
Android 5 Lolipop, will wake up a piece of code when the app is killed. Basically, the .on("notification") will be called only when foreground or background (switched to another application for example). App killing is when removed from RAM, by swiping it left or right when switching between previously opened apps. Apps like whatsapp fetch more data and images even when they are killed. A notification is able to trigger a piece of code. |
Same issue here:
1.10.5
I'm using Android Studio 2.3.3 recently updated, device Huawei P8, Android 6.0, EMUI 4.0.1
Close the App (not in background, is completly closed) and send Push Notification
Get notified by a message in Status bar
Nothing in UI but get this message in adb logcat | grep GCM
|
Get it working with EMUI devices (Huawei P8 Lite) using this: Problem, can we "protect" an app by default ... Source [6]: https://www.androidcentral.com/first-6-tweaks-you-need-make-your-huawei-or-honor-phone |
Yes, that was the problem, thank you very much |
Any Alternate to FCM/GCM when phone is in doze mode? |
@PetruMagdeleine yeah it's work but any alternate way to set programmatically. |
This thread has been automatically locked. |
I did not Recieve push Notifications when the app is not Running. It works perfect for my ios device and also an Android 4.4 and a Android 5.1 Device.
But on my Huawei Mate7-L09 with Android 6.0 (Kernel 3.10.86) i recieve push-notifications when the app is active or in Background, but not when the app is not Running.
I am using Phonegap Build with Phonegap Version 5.1.0 and Version 1.6.0 of the push-plugin.
This is the "init-code" of my App:
Below is the Message i sent from Backend:
This is the adb logcat when recieving an GCM Push when the app is not running:
I hope you can help me.
Thanks
Bastian
The text was updated successfully, but these errors were encountered: