identifierForVendor changes on reinstall
Asked Answered
J

3

22

identifierForVendor is not supposed to change on reinstall of app:

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.

https://developer.apple.com/reference/uikit/uidevice/1620059-identifierforvendor

However, I've just tested this with one of our live apps on the app store. Even with a number of other of our apps still installed on the device, if I reinstall app A the UUID returned from identifierForVendor changes every time.

It was not like this.

This used to work. But at some point, the UUID seems to have started changing on "simple reinstalls" (as stated above). Is this a known bug? Is identifierForVendor known to be broken versus the documentation above? Any workarounds (other than saving UUID to keychain, because that method breaks with iCloud syncing)?

Journey answered 17/6, 2015 at 2:44 Comment(5)
Keep identifierForVendor or custom UUID in KeyChain. See:How to preserve identifierForVendor in ios after uninstalling ios app on device?Hover
Let me quote myself "other than saving UUID to keychain, because that method breaks with iCloud syncing". Well, that method could work in some cases. Which means it will not work in all cases.Journey
You can make keychain entries device-specific (caveat: I recalled this from a WWDC video and went looking for resources - I haven't had the need to explicitly test this myself). andyibanez.com/using-ios-keychain and developer.apple.com/library/ios/documentation/Security/…Pretorius
I don't think I've seen this mentioned before, but if you use push notifications, maybe you can use the device token as a sort of UUID. Just a thought.Zedekiah
Hello @Journey it has been 3 years, 4 months and I'm still getting the same issue. Did apple fix it by any chance?Demineralize
B
15

It's a known bug. It seems like Apple made an update to AppStore that causes this new behavior for identifierForVendor around the 28:th May. If you search in the App Developer forum, there are other developers reporting the same problem.

The signature gc from Apple have replied on the issue with the following answer: "Please file bug reports on this at https://developer.apple.com/bug-reporting>. We're aware of this issue and are investigating. There's no known workaround at this time."

Balladist answered 17/6, 2015 at 7:38 Comment(1)
I found the/a thread in the new forum. Seems like it's a known issue like you say.Journey
K
1

identifierForVendor is expected to change when all vendor's apps are removed from the device. Also, it is bound to change if you're building and installing from Xcode directly.

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.

Source: UIKit/UIDevice/identifierForVendor

Kura answered 19/9, 2019 at 9:30 Comment(0)
K
0

We are about to resubmit using an App Group entitlement to give us shared NSUserDefaults. It sounds like App Group NSUserDefaults (unlike keychain-access-group and iCloud key-value storage entitlements) are shared on the device, but not over the iCloud account. If the shared "deviceid" NSUserDefault key doesn't exist, we'll save the IdentifierForVendor ID and then use that for all our apps once it saved.

Kollwitz answered 30/6, 2015 at 15:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.