Android - GCM - 不在后台接收推送通知 [英] Android - GCM - Not receiving push notifications on background

查看:108
本文介绍了Android - GCM - 不在后台接收推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

像华为或者小米这样的设备在后台不会收到推送通知。
其他品牌没有问题。
任何想法发生了什么?



更新




  • 我可以确认推送通知是由服务器发送的。

  • 我已经使用Firebase创建了一个新项目,但仍然发生同样的问题。 >解决方案

    一旦你杀死 xiaomi huawei 这些手机取消注册广播接收器,

    在通知情况下,您的GCM broadcastreceiver 在取消注册应用程序时取消注册,这很可能这是为什么。


    Devices like huawei or xiaomi are not receiving push notifications while they are in background. Other brands have not issues. Any ideas what's going on?

    Update

    • I can confirm push notification was sent it by server.
    • I did create a new project with Firebase, and still happens the same issue.

    解决方案

    Once you kill application on xiaomi, huawei these phones unregister broadcast receivers, services of the application.

    In case of notification, your GCM broadcastreceiver get unregistered on killing app, that is likely the reason for this.

    这篇关于Android - GCM - 不在后台接收推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆