如何解决同一应用程序在不同设备之间的供应商ID唯一性?
我一直使用identifierForVendor
为我的应用程序创建唯一标识符。根据:
它表明
"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.
Normally,the vendor is determined by data provided by the App Store. If the app was not installed from the app store (such as enterprise apps and apps still in development),then a vendor identifier is calculated based on the app’s bundle ID. The bundle ID is assumed to be in reverse-DNS format."
这是目标C中的代码
NSString *UDIDString = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
NSLog(@"Vendor ID %@",UDIDString);
下面是我的查询
A)如果从App Store安装了我的名为“ App_A”的应用程序,其供应商ID是否会针对不同设备返回相同的供应商ID?还是对于从AppStore安装的同一应用程序,每个设备将具有不同的vendorID?
B)如果我使用新版本更新应用程序,是否有可能更改vendorID?
感谢任何投入。请协助查询
解决方法
-
每个设备的唯一ID。
-
否,供应商ID不会随着版本更新而更改。
修改
摘自Apple的文档here:
在iOS设备上安装了该应用程序(或来自同一供应商的另一个应用程序)时,此属性中的值保持不变。 当用户从设备上删除该供应商的所有应用并随后重新安装其中的一个或多个应用时,该值就会更改 。使用Xcode 安装测试版本或使用临时发行版在设备上安装应用 时,该值也可以更改。因此,如果您的应用将此属性的值存储在任何位置,则应妥善处理标识符更改的情况。
这似乎很清楚地回答了您的问题。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。