UIDevice uniqueIdentifier deprecated - What to do now?

后端 未结 30 2136
日久生厌
日久生厌 2020-11-21 06:07

It has just come to light that the UIDevice uniqueIdentifier property is deprecated in iOS 5 and unavailable in iOS 7 and above. No alternative method or pr

30条回答
  •  一向
    一向 (楼主)
    2020-11-21 06:46

    UIDevice identifierForVendor introduced in iOS 6 would work for your purposes.

    identifierForVendor is an alphanumeric string that uniquely identifies a device to the app’s vendor. (read-only)

    @property(nonatomic, readonly, retain) NSUUID *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 onthe same device that come from different vendors, and for apps on different devices regardles of vendor.

    Available in iOS 6.0 and later and declared in UIDevice.h

    For iOS 5 refer this link UIDevice-with-UniqueIdentifier-for-iOS-5

提交回复
热议问题