gpt4 book ai didi

ios - iOS 中的每个应用程序都具有相同的 deviceToken 吗?

转载 作者:行者123 更新时间:2023-11-28 18:27:55 25 4
gpt4 key购买 nike

这个问题google了一下,搞得我一头雾水。 iOS 中的每个应用是否都具有相同的 DeviceToken

这是关于这个问题的 Apple 文档

A device token is an opaque NSData instance that contains a unique identifier assigned by Apple to a specific app on a specific device. Only APNs can decode and read the contents of a device token. Each app instance receives its unique device token when it registers with APNs, and must then forward the token to its provider, as described in Configuring Remote Notification Support. The provider must include the device token in each push notification request that targets the associated device; APNs uses the device token to ensure the notification is delivered only to the unique app-device combination for which it is intended.

最佳答案

不,每个应用程序都会获得自己的设备 token 。

另请注意,分配给应用程序/设备的设备 token 可能并且确实会不时更改,这就是为什么您始终需要将更新版本发送到您的推送服务器和/或任何其他可能使用设备 token 。


关于“不时”更改设备 token 的一些说明:

“不时”的意思是“有时,但不经常”

取自 Apple Documentation :

Never cache device tokens in your app; instead, get them from the system when you need them. APNs issues a new device token to your app when certain events happen. The device token is guaranteed to be different, for example, when a user restores a device from a backup, when the user installs your app on a new device, and when the user reinstalls the operating system.

关于ios - iOS 中的每个应用程序都具有相同的 deviceToken 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49005358/

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