【问题标题】:Push notification not receive with content_available使用 content_available 未收到推送通知
【发布时间】:2018-01-17 03:52:17
【问题描述】:

我正在与 firebase 合作,为应用添加推送通知功能,推送通知本身一切正常,但在应用的某些状态下,推送通知未收到。

前景/背景:

{
    "data":{
        "title": "title",
        "message": "message"
    },
    "content_available":true,
    "priority":"high",
    "registration_ids":[
        ""
    ]
}

当应用被用户杀死时出现问题,我发送相同的http请求但应用没有收到远程通知。

我在 firebase 上使用控制台进行测试,当应用程序被终止时收到通知,但我无法将 控制台请求 复制到 http 请求

这是我通过 firebase 控制台

制作的通知内容
[
    "google.c.a.c_l": label optional, 
    "google.c.a.e": 1, 
    "google.c.a.ts": IntValue, 
    "google.c.a.udt": 0, 
    "gcm.n.e": 1, 
    "aps": {
        alert = {
           body = mensaje;
           title = title;
        };
    }, 
    "google.c.a.c_id": IntValue, 
    "gcm.message_id": 0:1502103735577088%9218dc2f9218dc2f
]  

【问题讨论】:

    标签: ios firebase notifications firebase-cloud-messaging


    【解决方案1】:

    这就是 iOS 的工作原理,基本上。当您的应用程序被用户杀死时,它不再接收后台通知。

    这是一个有点旧但仍然准确的链接,其中包含一些更详细的信息:http://samwize.com/2015/08/07/how-to-handle-remote-notification-with-background-mode-enabled/

    【讨论】:

      猜你喜欢
      • 2011-08-23
      • 2014-08-06
      • 2019-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多