gpt4 book ai didi

android - Firebase 消息传递 - 什么 "content_available": true

转载 作者:行者123 更新时间:2023-12-04 23:43:45 25 4
gpt4 key购买 nike

我看到了很多 firebase push 的例子,比如

{ 
"to" : "egu9jGiMcew:APA91bFv2Rewdz.....KZZmEURvbq-aA2",
"data": {
"id": 19,
"title": "Title test",
"msg": "Text of the test",
"code": 2,
"infosUrl": "ttp://www.secondguide.tours",
"longitude": 5.5,
"latitude": 44.5,
"eventLocation": "nowhere",
"startDate": "24/07/2016",
"endDate": "25/07/2016",
},
"delay_while_idle" : false,
"priority" : "high",
"content_available" : true
}

我没有得到目的
"delay_while_idle" : false,    
"priority" : "high",
"content_available" : true

在这,有人可以解释一下吗?

最佳答案

如果您检查了 official documentation首先,您会看到相应的描述:

content_available - On iOS, use this field to represent content-available in the APNs payload. When a notification or message is sent and this is set to true, an inactive client app is awoken, and the message is sent through APNs as a silent notification and not through the FCM connection server. Note that silent notifications in APNs are not guaranteed to be delivered, and can depend on factors such as the user turning on Low Power Mode, force quitting the app, etc. On Android, data messages wake the app by default. On Chrome, currently not supported.


您的帖子标题仅询问 content_available ,但只是为了涵盖其他两个, priority (也来自文档):

Sets the priority of the message. Valid values are "normal" and "high." On iOS, these correspond to APNs priorities 5 and 10.

By default, notification messages are sent with high priority, and data messages are sent with normal priority. Normal priority optimizes the client app's battery consumption and should be used unless immediate delivery is required. For messages with normal priority, the app may receive the message with unspecified delay.

When a message is sent with high priority, it is sent immediately, and the app can display a notification.

delay_while_idle早就被弃用了,所以我不会费心提供它的行为。

关于android - Firebase 消息传递 - 什么 "content_available": true,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50765659/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com