gpt4 book ai didi

ios - 替代 [UIDevice currentDevice].identifierForVendor

转载 作者:搜寻专家 更新时间:2023-10-30 20:19:07 24 4
gpt4 key购买 nike

我有一种产品有两种不同的应用。并且这两个应用程序都为同一设备提供了不同的标识符(您会假设苹果会将其关联到您的开发者帐户,以便您可以在您的应用程序中重复使用这些信息),但我想知道他们能给我什么两个应用程序上的设备标识符相同?

最佳答案

identifierForVendor 正是您想要的。 UDID 在 AppStore 上是一个很大的 NO。用户可以选择退出 advertisingIdentifier。其他方式(通过 MAC 地址,如 ODIN1,以及依赖 UIPasteboard 的解决方案,如 OpenUDID)将在未来中断(提示:7)。

根据docs ,如果两个应用来自同一开发者,则您应该具有相同的标识符:

The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.

The value of this property may be nil if the app is running in the background, before the user has unlocked the device the first time after the device has been restarted. If the value is nil, wait and get the value again later.

The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.

关于ios - 替代 [UIDevice currentDevice].identifierForVendor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18168502/

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