手机锁定时不接收通知 [英] Not receive notification when mobile is lock
问题描述
我正在使用FCM. 当手机屏幕打开时,所有手机接收到通知(在我的情况下,有12个手机) 当手机被锁定时,服务器成功发送通知,但手机未接收到通知
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
推荐答案
在清单中添加此权限,以防止手机进入休眠状态.
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
在位于以下位置的受保护应用中 高级设置->电池管理器->受保护的APS
In protected apps located in Advanced settings->Battery manager->protected aps
这篇关于手机锁定时不接收通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!