Search code examples
iosobjective-cuuidnsuuid

Will iOS's device identifierForVendor UUID always be the same?


if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) {
        return [[[UIDevice currentDevice] identifierForVendor] UUIDString];
    }

Will this ever change? I originally wanted to use MAC address, but apparently 7+ doesn't return it. I've called this from a dev app i'm working on, and read that it is calculated using the bundle id.

Post app store release, will this be consistent forever?


Solution

  • From the UIDevice class reference:

    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. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.