Search code examples
objective-ciphoneipaduuidsskeychain

How to maintaining the unique identifier of iPad/iPhone even user reset device?


I have an app that using in some health caring center. When user login to system for the first time, my app will generate a UUID for current device. This UUID will be store it in SSKeychain and insert into DB . Next time, when login app, UUID will be get from SSKeychain, and update the last time that user login to SSKeychain info on DB.

Depends on UUID of devices, i can manage the number of devices that a center has. However, when device is reset, UUID of device seems to be removed from SSKeychain. So that, when user login again, my app will recreate a new UUID. This UIID will be insert into DB, while the old UUID still be in DB. This leading the real number of device in every center is different with DB.

So, could you show me some ways that create a unique identifier for each device(iPad, iPhone) that can be maintained even device is reset, restore or something else.

Thanks for advance.


Solution

  • First of all, I do not think that it is possible to generate a unique device identifier from the device itself. In previous times this was possible – you could simply ask the system for such a UDID (UUID of the device) –, but Apple stopped that for data protection reasons.

    To reset a device means that the device is reset afterwards. Being reset means that you cannot match the "old" device with a number of devices. The reset device does not match the old device as every other device wouldn't do. This is the sense of resetting.

    So, what you have to do is to let the user pair the reset device with one of the devices in a list on your server.