Reputation: 81
GCM push notification is not working in android when app is killed in some devices like lenovo and MI. Even after given permission from device still no help. I used wakefulBroadCast
and GCMListenerService
. But when app is killed, it is not getting message on Message Receive. I am stuck at this point. If anyone does this before please help and give some suggestions. Thank you in advance.
I'm not getting push notification when app is Killed or forcefully closed.
Upvotes: 1
Views: 1041
Reputation: 13469
You can read in this blog that closing an app by swiping it won't directly causes services to stop. It will only kill any background processes that exist for the process. Since you also tried using FCM and it's still not working, I guess that it's because of the device. As stated in the answer in this SO question, receiving notification even if the app was killed depends on the device where it is running. As you said, it only happens in Lenovo, MI and HTC phones. The reason you are no longer receiving pushes when the app is force-quit, is because the Service
of these devices has also been force-quit.
Upvotes: 1