Do not receive notification of sending GCM in MI phone if the application is killed

I included GCM in my project to receive push notification from the server. I can successfully receive push notifications on all devices (Nexus, Samsung, etc.), however, I do not receive notifications on my Xiaomi Xiaomi phone.

When the application is running or in the background, I get a notification, however, if I kill the application (removing the application from the latest applications), I do not receive the notification.

The preinstalled security application has an autostart function. Some applications have autorun enabled and some not. In my application, the autorun function is disabled. If I turn on autostart for my application, I will start to receive notifications, even if I kill the application.

How can I fix this problem? Please help me.

+5
source share
1 answer

Launch AutoStart

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

Screen lock start notification

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

I have succeeded in this. Hope this helps.

+8
source

Source: https://habr.com/ru/post/1237452/


All Articles