Not receive notification when mobile is lock

2019-07-18 23:46发布

问题:

I am using FCM. When mobile screen is ON , Notifications received by all mobiles ( In my case , there is 12 mobiles ) When mobile is locked , Notification send by server successfully but not receive by mobile

回答1:

Add this Permission in manifest which prevents your phone from sleeping.

<uses-permission android:name="android.permission.WAKE_LOCK"/>

also check in latest device their is concept of protected apps only protected app will run in background only these apps will receive notification when device is locked

In protected apps located in Advanced settings->Battery manager->protected aps