How to identify unique users without using a login

2019-06-17 05:47发布

问题:

I need to have a way to identify the users of my app, but without having a login system.

I looked into the UUID which gives me part of an answer to my problem, but as it's not the real UDID, it's not "really unique" : if the user re-installs the app, he gets a new UUID, and this can't work for me.

Is there a way I can get the device serial number or something unique like that? Anything of the sort that i could get from the device without having the user to fill any fields.

回答1:

You can try to use some unique random string that is stored in Key-Value Storage in iCloud of user.

So, when user launches your app for the first time you see that his iCloud stores no value so you generate and store it. And when user will launch app next time you will see this value and will act accordingly.

What is more important even if user will reinstall your app or will make factory reset of device you still be able to identify user by value in his iCloud.



回答2:

After a while we decided that it was either unreliable, impossible or really annoying to get unique user ID's without asking them to fill some kind of field and actually sign up.

We therefore decided to use their encrypted formatter phone numbers using the following process :

  • Ask for phone number & international code* (+1, +32, etc.)
  • Verify integrity of phone number programatically
  • If satisfactory, ask user to verify with alert
  • If okay, send pin code and wait for validation
  • If valid, signup to database.

The user's username is : formatted phone number (+32495555556 for example), and that string is then hashed in SHA-256, and finally we save that super-long string to the database and recognize everyone like that.

If you have any question please ask here so I can give some clarification. If you have a better idea I'd still be glad to hear it.