gpt4 book ai didi

ios - 推送通知 Json 中 "Content-available"的用途?

转载 作者:技术小花猫 更新时间:2023-10-29 10:51:28 26 4
gpt4 key购买 nike

目的是发送只有角标(Badge)值的推送通知,没有别的(没有横幅)。

我集成了parse sdk来测试推送通知并发送这个推送通知

{
"alert" :"",
"badge" :"787",
"Content-available" : "1",
"sound" : ""
}

所以推送通知在应用程序处于后台、前台和应用程序被杀死时发送。在带有角标(Badge)阀 78 的推送通知到达时删除一些数据的目的已经成功。我发送了相同的通知,其中删除了“内容可用”:“1”,但一切正常。

我对“Content-available”的理解是,将其值设置为 1 将允许推送通知而没有警报值。

所以我很困惑,或者我想知道这个推送通知 JSon 中“内容可用”的含义。

谢谢

最佳答案

如果您为该键提供值 1,(如果用户打开您的应用程序处于后台或已恢复)application:didReceiveRemoteNotification:fetchCompletionHandler:将被调用。

根据 RemoteNotifications Programming content-available定义为

Provide this key with a value of 1 to indicate that new content is available. Including this key and value means that when your app is launched in the background or resumed, application:didReceiveRemoteNotification:fetchCompletionHandler: is called.

(Newsstand apps are guaranteed to be able to receive at least one push with this key per 24-hour window.)

关于ios - 推送通知 Json 中 "Content-available"的用途?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27777632/

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