//身体就像这样
{
"to":
"/topics/NEWS"
,
"data":{
"extra_information": "This is some extra information"
},
Run Code Online (Sandbox Code Playgroud)
//我需要提供的通知
"notification":{
"title": "ChitChat Group",
"text": "You may have new messages",
"click_action":"ChatActivity"
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Firebase实施通知.当应用程序位于后台或前台时,会正确接收通知.所以,基本机制正在发挥作用.
现在我已将Content Extensions和Service Extensions添加到应用程序中.内容扩展在我使用本地通知时有效,但只要考虑可选字段,Firebase消息有效内容就会显示不正确.这是我的控制台图像的链接:

以下是Firebase远程通知有效负载(为了匿名而编辑了一些长Google数据:
{
aps =
{
alert =
{
body = "Eureka! 11";
title = "Patient is not doing well";
};
};
category = provider-body-panel;
gcm.message_id = 0:149073;
gcm.n.e = 1;
google.c.a.c_id = 2825604;
google.c.a.e = 1;
google.c.a.ts = 149073;
google.c.a.udt = 0;
mutable-content = 1;
}
Run Code Online (Sandbox Code Playgroud)
似乎"类别"和"可变内容"不在正确的位置.它们应该在aps有效载荷中.
如何让这些选项在有效负载中,以便我的应用程序可以正确解析它并将其与内容和服务扩展连接?
apple-push-notifications ios firebase firebase-cloud-messaging