10

I have heard stories where UIDevice.identifierForVendor changed during an app update from App Store.

This answer goes like "...There was a bug affecting the calculation of identifierForVendor when updating an app from app store...". See corresponding big report at rdar://22677034.

Do you have experienced such issues?
Was this a bug that has fixed since?

Geri Borbás
  • 15,810
  • 18
  • 109
  • 172

1 Answers1

16

According to the official documentation, a simple reinstall should not affect identifierForVendor.

However, it is documented behavior that the identifier changes if conditions are met. Don't assume that identifierForVendor always remains the same. There can always be edge cases where the system incorrectly identifies an update as a reinstall etc.

From the documentation linked above:

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.

Community
  • 1
  • 1
Tamás Sengel
  • 55,884
  • 29
  • 169
  • 223
  • 14
    I've encountered the `identifierForVendor` changed during app update or system update for around 45 out of 7000 user. Still not know why. it seems that saving `identifierForVendor` to keychain is a more appropriate solution if you want to use an unique string. But in that case using `identifierForVendor` or a random string will be the same, cause it already saved in keychain. – andrew54068 Oct 28 '18 at 06:24