There are a few alternatives to the IMEI or MAC address that Apple now provide.
One such is [[UIDevice currentDevice] identifierForVendor]
.
From Apple’s documentation.
An alphanumeric string that uniquely identifies a device to the app’s vendor.
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.
There is another alternative which, if you’re implementing a system to serve advertisements, you need to use [ASIdentifierManager advertisingIdentifier]
according to their documentation.
I find that identifierForVendor
is usually enough to implement a security layer, especially when you have a server side component that maintains a list of users and identifiers used.
You can also generate a UUID off of the identifierForVendor
as seen below.
Objective-C:
NSString *generateUUID = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
Swift 3:
let generateUUID = UIDevice.current.identifierForVendor?.uuidString
This should absolutely be enough for what you require.
2
solved Alternate to IMEI