gpt4 book ai didi

IOS 无声推送通知发送自定义键/值

转载 作者:行者123 更新时间:2023-12-01 22:21:35 25 4
gpt4 key购买 nike

我有一个需要发送自定义键/值对的用例。请参阅下面的示例:

 {
"aps":{"content-available":1},
"test_data":{"Name":"Vinay"}
}

我已经完成了这个练习,但我无法发送这个,而且我还没有找到苹果限制这个的明确证据。有人可以在这方面支持我吗?

最佳答案

是的,Apple 授权它进行静默推送。事实上,苹果解释了如何做到这一点:

To support silent remote notifications, add the remote-notification value to the UIBackgroundModes array in your Info.plist file. To learn more about this array, see UIBackgroundModes.

并且,在配置静默通知中:

The aps dictionary can also contain the content-available property. The content-available property with a value of 1 lets the remote notification act as a silent notification. When a silent notification arrives, iOS wakes up your app in the background so that you can get new data from your server or do background information processing. Users aren’t told about the new or changed information that results from a silent notification, but they can find out about it the next time they open your app.

-

For a silent notification, take care to ensure there is no alert, sound, or badge payload in the aps dictionary. If you don’t follow this guidance, the incorrectly-configured notification might be throttled and not delivered to the app in the background, and instead of being silent is displayed to the user.

更新:

但似乎不可能有完全静默的推送和自定义数据。它没有很好的记录,但看看这个:https://stackoverflow.com/a/36327058/2846494

来源: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW6

https://stackoverflow.com/a/36327058/2846494

关于IOS 无声推送通知发送自定义键/值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36735133/

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