JuicyFruit
JuicyFruit

Reputation: 2668

Apple UUID while updating whole project with same bundle ID

I have an application written in mixed Obj-C/Swift, it uses UUID for identification of a device. I am rewriting whole application in Swift, using another project with same bundle ID. However when I try to update old project build with Xcode using new one build with Xcode too, new application UUID is different. What I am missing? Shouldn't it be the same because I am using same bundle ID?

Upvotes: 0

Views: 688

Answers (2)

JuicyFruit
JuicyFruit

Reputation: 2668

My bad, it indeed stays the same, old application was saving one in keychain and using it even after reinstall.

Upvotes: 0

taka
taka

Reputation: 1427

Does UUID mean UIDevice.current.identifierForVendor?.uuidString ?

If so, it changes in some situations documented in Apple developer page.

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

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.

Upvotes: 2

Related Questions