You have to use Keychain to store Unique Id , this will not change even if user delete app

You can use any wrapper Source code to do this

here is an example https://github.com/Joe0708/KeychainUUID

More Answer related to the Same Query


At the beginning I'd like to mention that I do not know any method that directly answers your question, especially that Apple does not allow you to read IMEI and other similar stuff due to privacy concerns. This has been answered here.

The workaround might be as follows

Take a look at the UIDevice class, especially at the identifierForVendorProperty which provides you (according to documentation ) with a device specific value.

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.

As far as i know some financial apps are secured this way to permit only one device to access the account. This however requires registering a device each time application is reinstalled.

Alternatively you can use UUID you generate within your app (first run) and then you assign it for the user online. It might take the form similar to two step verification process. Be aware however that with such restrictions user will have to be online all the time to use your app.

Credit Goes to: stackoverflow.com

Related question with same questions but different answers