[[+content_image]]
E
E
ex3xeng2016-04-22 17:00:10
Objective-C
ex3xeng, 2016-04-22 17:00:10

How to get DeivceID (objective-c - IOS)?

Good day! Tell me how to get a unique DeviceID so that after restarting the application it would be the same.
There is a code found on the Internet [[[UIDevice currentDevice] identifierForVendor] UUIDString]; in fact, it generates DeviceID, but it doesn’t work on my work computer and my friend’s emulator is fine, it constantly generates the same code, but on my home computer it generates a new line every time! how is that? what have I messed up?
Today I demolished the OS X system, reinstalled it completely, installed the latest xcode and still the same trouble, what could be the problem?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
M
ManWithBear, 2016-04-22
@ex3xeng

There is no way to get a unique ID for a device. There was a way before, but Apple closed it.
What you found is an identifier for advertisers. It can only be used if your app has ads. Otherwise, you will not pass moderation in the App Store. And even if there is advertising, there are some restrictions.
So you have to do your own thing.
UPD. Alternatively, use the NSUUID and store it in the keychain, it will survive the deletion of the application. But this is not documented, and may be fixed in the future.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question