IdentifierForVendor

后端 未结 3 1866
借酒劲吻你
借酒劲吻你 2020-12-16 05:23
NSString *identifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

The code above gives two different identifiers on the same phon

3条回答
  •  失恋的感觉
    2020-12-16 06:20

    The vendor is not determined by the team ID, but by either:

    • The data provided by the App Store (if the downloaded from the App Store)
    • Parts of the bundle ID (if deployed using any other means)

    This varies depending on whether the device is running iOS 6 or 7+.

    According to the -[UIDevice identifierForVendor] documentation:

    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.

提交回复
热议问题