IOS Unique User Identifier across Devices
Asked Answered
A

2

6

thank you for taking the time and interest reading this and hopefully helping me out.

I need an unique user identifier for IOS, and what I mean with unique user identifier is a unique string that Apple provides that is unique for user not device, meaning that it will stay the same across devices. I thought about the Apple ID or something like that, but it´s not possible, because Apple does not provide it(at least not that I know of), but I want something similar to that.

It cannot be the UDID, because(besides being deprecated) it´s not persistent across devices. I want this in order to authenticate a user, without the user having to login, or signup. It is possible to do so, because some apps do so. I didn not log in or anything with another device, but it authenticated me. I had thought it was with the Apple ID, but that´s not possible to do.

I checked this answer: iOS unique user identifier. And it seems that it might be the solution, but I don't quite get it, as I don't see how it would be unique to every new user(being able to distinguish between multiple users, and the same user, but on different device).

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

PD: I use Titanium´s Appcelerator, not Apple´s IOS SDK or anything like that. But it´s not that important, I just want to get the process to be able to do it with Titanium's Appcelerator

PS: NOTE:

Thank you for answering and so fast!. I have read it many times and I just don't get it. Could you guys help me understand it a little bit better?

The way I understand it is this.

1.-Create an UUID(changes with every installation) 2.-Store it to the Keychain(As far as I know, the values saved on the keychain are local to the device) with a default service(I think Ill put it with the application's id-com.bla.bla-), and also a default account, I think Ill leave it as "users".

This will all be local, so every single installation will do this, with a different UUID for each installation(not necessary every user) 3.-Save the UUID to the NSUserDefaults. 4.-Save the UUID to the Cloud's public data store.(The UUID in the Cloud´s Data Store, Keychain and NSUserDefaults should be the same)

So, if 5 installations are run, the Cloud´s 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 executed every time you run the application, checking first if there is a value stored on the public cloud store. Here´s where I am confused, how will a different device know which UUID is yours? I mean, there are 5 different UUIDS to chose. Maybe it´s not supposed to be saved on the public data store, but on the private data store, but for that you would need to also identify each user. This is where I get so confused.

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

So, I get confused on the 5th step, most people understand that solution, without any more explanation, so I must be ignorant in the way something works, maybe the cloud services? I think the problem is that maybe I'm not understanding how the iCloud works, and how it stores it´s values. I just don't get how the 5th(random number, it might be the 2nd or 2000th) device of X running the app, will know that the UUID XXX... is the UUID of user X, and not the UUID of user Z.

Thank you again for answering so fast, I thought maybe I would have to wait a couple of days, not a couple of minutes. Forgive me for my ignorance, I'm kind of a noob on this matter, but I would like to learn. Been stuck on this problem for days

Ashcraft answered 2/7, 2012 at 19:25 Comment(0)
D
2

The answer you referred to is the correct way to identify your users. The solution is to save the value of that identification called a UUID (Unique User ID) - as opposed to a UDID (Unique Device ID).

The only down side to this of course for you as a developer is that the user could delete and install the app again and have a different ID.

Dunaj answered 2/7, 2012 at 19:28 Comment(0)
C
2

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

I dont see how it would be unique to every new user

Well, accordint to this Wikipedia article:

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

So you can be pretty sure that the UUID will be unique to each user.

Additionally, the MAC address is based off of the MAC address of your ethernet card, the timestamp, and some other miscellaneous information. This adds to the uniqueness of the UUID as according to this question on Superuser:

[MAC addresses] are reasonably unique.

  • The first 3 octets define the manufacturer.
  • The last 3 octets are usually generated at the time of PROM burning. It's up to the manufacturer how they do this.

That obviously gives 16,777,215 possible unique MAC addresses per manufacturer. That's quite alot, so the manufacturer shouldn't re-use one.

So basically, the UUID adds an additional degree of uniqueness to the MAC address.

In summation, for your intents and purposes, the UUID would be perfect.

Hope this helps!

Counterforce answered 2/7, 2012 at 19:35 Comment(7)
@Ashcraft - No problem. We all started like that.Counterforce
Thank you for being so understanding :) I love SO :P. Could you please help me understand the process better?Ashcraft
@Ashcraft - In your note where you say 5 installations are run in step 4, do you mean on separate devices? Also, when you say Cloud, do you mean iCloud or some server you have setup? ThanksCounterforce
Sorry for taking so long to answer, had to do some chores. Yeah, on separate devices, and also different users. It´s gonna be a game, so for example, you as user Qegal are the 1st player, you run it on your device A, so the first installation would be for Qegal-A, the second one would be Sismetic-A(me with another device), and so on, and then you would try to play it on another device, so it would be the installation Qegal-B. How would your B device know you´re Qegal and not me? By Cloud I mean iCloudAshcraft
I am using Titanium's Appcelerator, which implements the Cloud Services, so to implement something that´s on Apple's IOS SDK, the Titanium's developers need to implement it on their SDK for me to use, or I have to find a module compatible with Appcelerator. They refer the iCloud as ACS(Appcelerator Cloud Services), which implements Apple's iCloud service.Ashcraft
Im sorry, but I still dont understand, could you please help me?Ashcraft
let us continue this discussion in chatCounterforce

© 2022 - 2024 — McMap. All rights reserved.