I am going to imei the one who has logged into my application. And I'll give it a special code for security. It just has to be that code and IMEI that can not enter from another phone. What I will do with iOS.They will deal with this code. But, it is no longer possible to get IMEI in iOS. What I will do with iOS. Also, it is no longer possible to mac address in İOS, right?
-
Yes iOS doesn't allow you to capture IMEI or mac address. Why do need this anyways. – Sachin Vas Feb 15 '17 at 08:31
-
@SachinVas for security – Girl_engineer Feb 15 '17 at 08:51
-
Generate a random string using UUID and store it in the keychain. Also, maintain a list of users in the server who have already used their code. This way you will be sure that its only once. – Sachin Vas Feb 15 '17 at 09:43
-
@SachinVas Hi, ı have reached your question limiT. Would you please give me a positive votes? I have questions to ask – Girl_engineer Feb 23 '17 at 07:42
1 Answers
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.

- 193
- 2
- 12

- 2,528
- 2
- 23
- 32
-
There are a few situations I do not understand. First, is uuid valid in android? Second, is uuid available on every phone? – Girl_engineer Feb 16 '17 at 05:16
-
uuid available for every phone, device manufacturer will provide the uuid – Naresh Kumar Feb 16 '17 at 11:13