Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does UUID getting changed for some cases

I am using user's device UUID to get unique device.

NSString  *currentUUIDString = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

I know that UUID getting changed if the app gets deleted/reinstalls (Apple document).

But Does UUID getting changed for following cases?

  1. If app has been updated. (Found same question)
  2. If the device OS version has been upgraded.
  3. If do iCloud/iTunes backup and restore.
  4. If the device has been reset. (In this case, I think UUID Keychain storage will not work. Keychain storage also getting cleared I guess.)

Edit:

No, This is not duplicate, that question is related to how to identify the device uniquely and I have already followed. I know that we can use UUID to identify device uniquely. But my concern is what are the frequencies that UUID might get changed and if changed then what are the scenarios in which it can be changed.

like image 708
Kirti Nikam Avatar asked Jun 29 '15 12:06

Kirti Nikam


People also ask

What can cause a file's UUID to change?

Anything that affects the file-system will also change its UUID. Under normal circumstances this will be Under rare circumstances we may be faced with an external drive that mounts a temporary filesystem (e.g. live systems booting from an USB drive).

What is a UUID and how do I use it?

One option we have is to use a UUID. What is a UUID? A UUID – that’s short for Universally Unique IDentifier, by the way – is a 36-character alphanumeric string that can be used to identify information (such as a table row). Here is one example of a UUID: acde070d-8c4c-4f0d-9d8a-162843c10333

What are the disadvantages of using UUIDs?

However, in most cases the disadvantages of using something like a sequential identifier significantly outweigh the minimal increase in storage costs that comes from using UUIDs. UUIDs are extremely popular and widely used for a variety of different identification purposes.

Is it safe to merge UUIDs?

The chances of a duplicate UUID are so low it is safe to assume each ID will be unique. Separate computers can generate UUIDs at the same time with no communication and still be confident the UUIDs are unique. Independent systems that use UUIDs can be safely merged at any time without worrying about collisions.


1 Answers

Yes

The device's identifierForVendor is an excellent way of identifying the device. It will change if the app (and all apps from the same developer) is removed from the device and reinstalled. It does not depend on wifi/Bluetooth connections. With the exception of a bug last year, it does not change with operating systems. ...... You could also write your own UUID to the keychain - that survives delete/reinstall of the app...You could also write something to the user's iCloud key-value file. That would be user-specific rather than device-specific. It also survives delete/reinstall. I think that is what you want.

like image 95
Jogendar Choudhary Avatar answered Oct 30 '22 21:10

Jogendar Choudhary