Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not receiving GCM push notification in MI phone if app is killed

I integrated GCM in my project to receive push notification from server. I am able to successfully receive push notification in all the devices (Nexus, Samsung etc), however, I am not receiving notifications on my Xiaomi MI phone.

When the app is running or is in background then I am receiving notification however if I kill the app (by swiping the app away from recent apps) then I don't receive any notification.

In pre-installed Security app there is an Auto-Start feature. Some apps have this auto-start feature turned ON and some don't. My app have this auto-start feature turned OFF. If I turn auto-start ON for my app then I start receiving notifications even if I kill the app.

How can I fix this issue? Please help me out.

like image 554
Nitesh Kumar Avatar asked Dec 05 '15 11:12

Nitesh Kumar


People also ask

Why is my phone not receiving push notifications?

Settings > Sounds & Vibration > Do Not Disturb: if this setting is enabled, Push Notifications will not be received. Make sure this is disabled. Settings > General > Background App Refresh: this setting allows the app to run in the background and must be turned on.

How does GCM push notification work?

The first step in GCM is that a third-party server (such as an email server) sends a request to Google's GCM server. This server then sends the message to your device, through that open connection. The Android system looks at the message to determine which app it's for, and starts that app.

Are push notifications guaranteed?

Android push notifications sent via GCM / FCM are not reliable due to various issues with GCM's underlying architecture [1] [2] [3]. Push notifications may be delayed, rate-limited, lost in transit, or arrive in a different order than which they were sent.

How does mobile app push notification work?

Definition: A push notification is an automated message that is sent to the user by the server of the app that's working in the background (i.e., not open.) Another way to describe it is a push notification is a message that's displayed outside of the app.


1 Answers

Start AutoStart

Open Security App -> Permissions -> Auto Start Management.
Add/Enable your app as auto start apps

Start Lock Screen Notification

Open Settings App -> Notifications - Manage Notifications.
Tap on your App and select all cases.

i got success with this.. Hope it helps..

like image 55
Nikhil Borad Avatar answered Sep 21 '22 12:09

Nikhil Borad