问题描述
public class Notification extends FirebaseMessagingService {
private static final String TAG = "MyFirebaseNotification";
@Override
public void onMessageReceived(final RemoteMessage remoteMessage) {
Map<String, String> data=null;
Log.v(TAG,"notification Received");
Log.v(TAG,remoteMessage.getData().toString());
}
}
应用程序被杀死时没有调用方法.即使应用程序被杀死,我如何接收通知,而不是在前台或后台.
Method is not being called when application got killed. How do i receive notifications even if the app is killed,not in foreground or background.
推荐答案
请在您的应用关闭时(重启或刷卡后)检查以下命令
Please check the following command while your app is closed (after a reboot or after swiping)
adb shell dumpsys package MY-PACKAGE | grep stopped
如果您可以阅读 stopped=true,则表示您的设备制造商实施了一种非标准行为,包括在滑动时强制停止"应用程序.
if you can read stopped=true it means that the manufacturer of your device implemented a non standard behavior consisting in "force-stopping" applications when they are swiped.
force-stopping 非常类似于禁用应用程序,直到用户再次打开它.当应用程序处于该状态时,许多 android 行为将不起作用(广播、警报..)
force-stopping is very similar to disabling the app until the user opens it again.
while the app is in that state many android behaviors will not work (broadcasts, alarms..)
如果这是您看到的行为的根本原因,您应该联系制造商并要求他们通过删除这种非标准行为来修复设备
If this is the root cause of behavior you are seeing you should contact the manufacturer and request that they fix the device by removing this non-standard behavior
这篇关于应用程序被杀死时未收到使用 FCM 的推送通知 android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)