首页 文章

使用https://fcm.googleapis.com/fcm/send发送Firebase数据邮件时出现无效注册?

提问于
浏览
2

{“to”:“testTopic”,“data”:{“key1”:“val1”,“key2”:true}}

200回复,但响应机构有:

{
    "multicast_id": 6098503498585,
    "success": 0,
    "failure": 1,
    "canonical_ids": 0,
    "results":[
        {
        "error": "InvalidRegistration"
        }
    ]
}

So the onMessageReceived() is not triggered, neither app in foreground nor in background? Why do I get InvalidRegistration ? What am I missing?

第3点的服务器密钥来自Firebase项目设置 - > Cloud 消息传递 - >服务器密钥

1 回答

  • 1

    在4.你的JSON需要一个前提

    / topics /

    为了“到”因此:

    { "to": "/topics/testTopic",....}
    

相关问题