Zai Nguyễn
Zai Nguyễn

Reputation: 195

How to get unique value of iOS device

I'm writing an application that is used to manage the coming time of an employer by worklight. This app is used when the employer comes to the company every day. When they need to check in, the app will get:

+ geolocation
+ employer id
+ unique value of device (unchange value of device, ex: imei on Android).

and send the data to a database.

My problem is that I do not know which unique value of an iOS device I can take. Does anyone have any suggestions for me?

Upvotes: 0

Views: 558

Answers (1)

Prajeet Shrestha
Prajeet Shrestha

Reputation: 8108

You can no longer get a unique ID per device. identifierForVendor is the best you're going to get. Apple has systematically disabled identifying a specific device so that users' IDs can't be passed around by marketers.

UIDevice *device = [UIDevice currentDevice];

NSString *currentDeviceId = [[device identifierForVendor]UUIDString];

Upvotes: 3

Related Questions