【发布时间】:2020-11-30 15:22:59
【问题描述】:
我们有两种 firebase 通知,一种带有 notification 字段,另一种没有(系统使用此字段显示横幅)。
with 总是被接收,without 在某一行尝试后被接收,然后停止接收。
这些是有效载荷:
总是收到的:
{
"content_available": true,
"data": {
"pushCategory": "ALEXA",
"body": "body",
"message": "message",
"title": "status/update",
"updateStatus": {
"operationId": "7fc0e1ff-cc0d-4045-8b30-69710bf80c24",
"status": 0,
"action": "makecoffee",
"description": "",
"stock": {
"remaining": "91",
"threshold": "10",
"depletion": false
}
}
},
"notification": {
"title": "title",
"body": "body msg"
},
"apns": {
"headers": {
"apns-priority": "10"
}
},
"to": "----"
}
不是随机收到的:
{
"content_available": true,
"data": {
"pushCategory": "ALEXA",
"body": "body",
"message": "message",
"title": "status/update",
"updateStatus": {
"operationId": "7fc0e1ff-cc0d-4045-8b30-69710bf80c24",
"status": 0,
"action": "makecoffee",
"description": "",
"stock": {
"remaining": "91",
"threshold": "10",
"depletion": false
}
}
},
"apns": {
"headers": {
"apns-priority": "10"
}
},
"to": "----"
}
始终会收到直接使用 APNS 服务器且不带 alert 字段的等效通知。 (alert 字段是告诉系统显示横幅的字段)
我联系了 Firebase 支持,但问题一直存在,您知道可能是什么问题吗?
【问题讨论】:
-
第一个是用户看到的通知吗?第二个是无声通知?我的意思是为什么
content_available对他们俩都是真的? -
如果第二个是静默通知,那么 tl;dr 静默通知的传递机会远小于非静默通知
标签: ios firebase push-notification firebase-cloud-messaging