@
mushank 刚刚查过了, identifierForVendor 对于同一个厂商来说,是不变的。如果是从 store 下载的, store 会给设定 vendor ,如果是用企业证书分发,是会用 bundle id 判断。这个个人觉得不会出现同一个供应商的程序卸载之后会不同,如果这样的话,也不需要提供这个 API 了。
唯一需要注意的是,用 bundle id 判断的时候, iOS 6 和 iOS 7+判断部分不同( iOS 6 是前 2 部分, 7+不是)。
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.
On iOS 6, the first two components of the bundle ID are used to generate the vendor ID. if the bundle ID only has a single component, then the entire bundle ID is used.
On IOS 7, all components of the bundle except for the last component are used to generate the vendor ID. If the bundle ID only has a single component, then the entire bundle ID is used.