Will two devices have the same "UUID"

In my iOS app, I have to prevent the user from using the iOS app for each device. For this, I found a solution where we can use the identifierForVendor method UUID (Universally Unique Identifier)

, which will generate a unique identifier to uniquely identify the app on the device. (I don't use UDID (Unique Device Identifier)

it here because Apple rejects apps if the app uses a UDID).

So my question is, is there any possibility for two devices to have the same UUID

. any idea?

EDIT 1:

I have another doubt that I installed the same app on different two devices and saved its string UUID

to the device KeyChain

. Both devices have the same account iCloud

. Now, while syncing iCloud

these two devices, will one of my devices KeyChain

be overwritten?

EDIT 2:

I found the answer for EDIT 1 as "Yes, through iCloud Keychain

, KeyChain

will sync with another one of my devices, and Id will get the same device ID from here and below the answer too"

For the element to be synchronized with iCloud Keychain

, the Id must explicitly set the attribute kSecAttrSynchronizable

. Using the API SecItem

, we can set this attribute when adding a keychain element.

Is there any tutorial on how to add an item to KeyChain

(no third party libraries)?

+3


source to share


2 answers


No, no two devices are the same UUID

. I am 100% sure of this. So go to method identifierForVendor

.

But the setting UUID

can be changed when you reinstall the app on your device (unless there is another app for the same provider).

The value in this property remains unchanged as long as the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user uninstalls all of these providers' apps from the device and then reinstalls one or more of them. The value can also change when installing test builds using Xcode, or when installing an application on a device using an ad-hoc distribution. Therefore, if your application stores the value of this property anywhere, you should gracefully handle situations in which the identifier changes.

EDIT



YOUR QUESTION

I have another doubt that I installed the same app on two different devices and stored its UUID string in the KeyChain device. Both devices have one iCloud account. Now when doing iCloud sync for these two devices, will one of my KeyChain devices be overwritten?

ANSWER

YES. Your key fob will be overwritten. This way you have the same UUID for both devices.

+2


source


I thought NO!



The value of this property is the same for apps that are from the same vendor running on the same device. A different value is returned for applications on the same device that are shipped from different vendors and for applications on different devices regardless of the vendor.

Usually the provider is determined by the data provided in the App Store. If the app was not installed from an app store (for example, enterprise apps and apps still in development), then the vendor ID is calculated based on the app bundle ID. The packet identifier is assumed to be in reverse DNS format.

+1


source







All Articles