Unique iOS user ID for all devices

Thank you for taking the time and interest in this reading and hopefully helped me.

I need a unique user ID for iOS, and what I mean with a unique user ID is the unique string that Apple provides, which is unique to the user, not the device, which means that it will remain the same on all devices. I was thinking about an Apple ID or something like that, but this is not possible because Apple does not provide it (at least not in the way I know), but I need something similar to this.

It cannot be a UDID, because (besides being deprecated), it is not supported on different devices. I want this to authenticate the user, without having to log in or register. This can be done because some applications do this. I did not log in or anything else with another device, but it authenticated me. I thought it was with an Apple ID, but it is impossible to do.

I checked this answer: unique iOS user id . And it seems that this may be a solution, but I did not quite understand it, because I do not see how it will be unique for each new user (the ability to distinguish between multiple users and the same user, but a different device).

I really appreciate people reading this and trying to help. Thanks you

PD: I use the Appizer from Titanium, not the Apple IOS SDK or something like that. But this is not so important, I just want the process to be able to do this with the Titanium Appcelerator

PS: NOTE:

Thanks for the reply and so fast !. I read it many times, and I just don't get it. Could you guys help me figure this out a little better?

As I understand it, it is.

1.-Create a UUID (changes with each installation) 2.-Save it in the key chain (as far as I know, the values โ€‹โ€‹stored on the key chain are local to the device) using the default service (I think I put it with using the application id-com.bla.bla-), as well as the default account, I think I left it as โ€œusersโ€.

All this will be local, so each installation will do this with a different UUID for each installation (not required for each user) 3. Store the UUID in NSUserDefaults. 4. Store the UUIDs in Cloud Cloud Storage (UUIDs in Cloud Data Warehouse, Data Keychain and NSUserDefaults must be the same)

So, if you run 5 installations, the Cloud public data store should be like this:

An Array of 5 values: [ XXXX-EEEEE-FFFFF, SFSDFFWE-WERW-SDFS, XXXX-XXXXX-XXXXX, ZZZZZ-ZZZZ-ZZZZX, XZXZZX-ZXZXZXS-ADADS ] 

5. All this will be performed every time the application starts, first checking to see if there is a value stored in the public cloud storage. That's where I am confused, how does another device know which UUID belongs to you? I mean, there are 5 different UUIDS. It may not need to be stored in a public data store, but in a private data store, but for this you will also need to identify each user. Here I am so confused.

If there is no UUID set, complete the last 4 steps.

So, I am confused at the 5th step, most people understand this solution without any explanation, so I have to be ignorant about how something works, maybe cloud services? I think the problem is that maybe I donโ€™t understand how iCloud works and how it preserves its values. I just donโ€™t understand how the fifth (random number, it can be the 2nd or 2000s) device X, which starts the application, will know that the UUID XXX ... is the UUID of user X, and not the UUID of user Z.

Thanks again for the answer so quickly, I thought maybe I would have to wait a couple of days, not a couple of minutes. Forgive me for my ignorance, I kind of like a noob about this, but I would like to know. Stuck in this problem for several days

+6
source share
2 answers

The answer you refer to is the correct way to identify your users. The solution is to keep the value of this identifier called a UUID (unique user identifier), as opposed to a UDID (unique device identifier).

The only side for this, of course, for you, as a developer, is that the user can uninstall and install the application again and have a different identifier.

+2
source

As Daniel said, a UUID is the right way to identify your users. I just want to add this; you said, that

I do not see how it will be unique for each new user

Ok, I agree with this Wikipedia article:

The randomly generated UUIDs have 122 random bits ... only after generating 1 billion UUIDs every second over the next 100 years, the probability of creating just one duplicate will be about 50%. The probability of one duplicate will be about 50% if each person on earth has 600 million UUIDs.

Thus, you can be sure that the UUID will be unique for each user.

In addition, the MAC address is based on the MAC address of your local network, timestamp, and some other various information. This adds the uniqueness of the UUID in accordance with this superuser question:

[MAC addresses] are quite unique.

  • The first 3 octets define the manufacturer.
  • The last 3 octets are usually generated during PROM recording. It is to the manufacturer how they do it.

This, obviously, gives 16,777,215 possible unique MAC addresses for each manufacturer. This is quite a lot, so the manufacturer should not reuse it.

Basically, a UUID adds an extra degree of uniqueness to a MAC address.

In summation, for your goals and objectives, the UUID will be ideal.

Hope this helps!

+2
source

Source: https://habr.com/ru/post/919524/


All Articles