首先,FCM 并不符合需求
FCM does not process messages if an app is "killed" or force stopped. When a user kills an app it is an indication that the user does not want the app running so that app should not run till the user explicitly starts it again.
https://github.com/firebase/quickstart-android/issues/368#issuecomment-343567506
Starting Jan 2019, FCM will not deliver messages to apps which were put into background restriction by the user
https://firebase.google.com/docs/cloud-messaging/android/receive
看上去是个无解的操作,fcm 似乎只能推消息给被电池优化干掉的 app,并且推送会拉起 app 做处理,仍然非常耗电。
这里有两个问题
- 对开发者来说,Android 体系(这里指有 GMS 的手机)内存在类似 APN 的推送手段吗?
- 对用户来说,想要更低的耗电下收到提醒,绿色守护捐赠版是不是最佳选择呢?