6
votes

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.

1
@VipulAsri The link you shared is for turning Auto-Start ON/OFF manually. I don't want the user to follow these steps manually. I want the Auto-Start to be by default enable when user installs my app. If other apps (Facebook, Whatsapp, line, linkedin) have this enabled by default then there must be some way to accomplish it via coding.Nitesh Kumar
I think you have changed the os that if swipe the app away it will close the app totally for battery save. So you can try to set the gcm priority to high, or setting up a separate service to receive the GCM messages.bjiang
@bjiang I haven't changed the OS. I also tried creating a service which will keep always running but still no help.Nitesh Kumar
@NiteshKhatri did you get any solution for this?activesince93

1 Answers

9
votes

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..