identifierForVendor returns the same identifier even if I removed all the applications for the same vendors - ios

I'm experimenting a little with the identifierForVendor API.
As per the doc
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. Therefore, if
your app stores the value of this property anywhere, you should
gracefully handle situations where the identifier changes.
In Debug or Release with Ad Hoc, I cannot replicate this behavior. The identifier still remains the same even if I remove all the applications I have installed for the same vendor (the reversed domain name I'm using, e.g. com.test).
Is this can be observed only for App Store distribution? Am I missing something?
I'm running on a iOS 8.3.
Related question: iOS7 - Device unique identifier.

Related

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?
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.
My bad, it indeed stays the same, old application was saving one in keychain and using it even after reinstall.

Vendor ID changes with app re-installation with iOS 11 GM

I've just noticed that the vendor id is changing whenever the app in uninstalled and re-installed with iOS 11, but does not with iOS 10.
I can't find any reference to this being intentional behavior from Apple, but as this is occurring in the Gold Master of iOS 11 presumably it can't be a bug at this very late stage.
Anybody have any info of this?
[P.S. Yes I know it can be stored in the keychain]
This is expected behavior.
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.

Different UUID in swift 2.2

Before Swift 2.2 the UUID value was the same every time I opened the app, now changes at every opening
I use this code:
UIDevice.currentDevice().identifierForVendor!.UUIDString
How can I do now to identify the user?
Every time you delete the app, the UUID may change.
If you just close and open the app, it's should be the same.
But if you delete the app (or install it again via xcode), it might change.
There are a couple of answers that explain why the UUID is resetting. There's one that offers a potential work around, but I'd consider it far from ideal. But I want to highlight something important about the way UUID's work that serves as a great workaround that has absolutely zero impact on the production OR debug version of your code base or compiled binary.
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.
All you have to do to prevent this value from changing while developing App-A is to simply install App-B from the same vendor (yourself) and keep it installed during the life time of App-A's development. This is literally as simple as starting a blank new iOS project and install the blank slate to your test device (using the same developer account & such), and then never uninstall it again during development.
App-B keeps a constant UUID for the vendor (yourself) so no matter how many times you delete and reinstall App-A, it will always keep the same UUID.
This actually seems to be a bug IMO. Everytime I run my app in the simulator it generates a new Vendor ID. You can probably get round it by storing the ID into NSUserDefaults on the first bootup then retrieving / comparing the value from NSUserDefaults instead of getting it from identifierForVendor. This will save a static vendor id in defaults but in theory the vendor id will still be changing every boot up.
Kind Regards,
Krivvenz.
Update: I can confirm I have installed multiple apps on the same simulator too but the vendor ID is still changing on every boot.
Update 2: - I have logged this as a bug with Apple - 26195931.
The value of this property is the same for apps that come from the
same vendor running on the same device. A different value is returned
for apps on the same device that come from different vendors, and for
apps on different devices regardless of vendor.
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.
Refer this link for more info.

identifierForVendor changes on reinstall

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)?
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."
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
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.

Alternative to [UIDevice currentDevice].identifierForVendor

I have one product that has two different applications. and both the applications it gives me different Identifiers for the same device (you would assume that apple would associate this to maybe your developer account so that you can reuse the information across your applications), but I was wondering is their anything that would give me the same identifier for a device on both the applications?
identifierForVendor is really what you want. UDID is a big NO on the AppStore. A user can opt out to advertisingIdentifier. Other ways (by MAC address, like ODIN1, and solutions that rely on UIPasteboard, as OpenUDID) will break on the future (hint: 7).
According to the docs, you should have the same identifier if both apps are from the same developer:
The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.
The value of this property may be nil if the app is running in the background, before the user has unlocked the device the first time after the device has been restarted. If the value is nil, wait and get the value again later.
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. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.
OpenUDID is the best solution until now, even if it also may be changed if the device is reset.

Resources