0

I would like a way to uniquely identify users, but as I've learned, Apple won't let you take the user's phone number without asking, nor can you use the UDID anymore, etc. Is there any data I am allowed to take from the phone to uniquely identify our users server-side? (I want to avoid prompting the user for information, for ease and simplicity)

At the very least, is there a way to know when an iphone changes owners; so I can erase app data from the previous owner?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Patrick
  • 1
  • 1
  • 3
  • Have you reviewed http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now ? – nobody Aug 05 '14 at 18:31

2 Answers2

2

You can generate a GUID one time the first time the app is loaded and send back to server. This will not be unique to user if they reinstall though. If you have a login of any kind you can tie that info to your generated GUID to be a bit more specific.

savner
  • 830
  • 6
  • 7
2

There is a specific UUID that you can use called the identifierForVendor

@property(nonatomic, readonly, retain) NSUUID *identifierForVendor

The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor Via Apple Docs

UPDATE
Swift Example

    let udid = UIDevice().identifierForVendor.UUIDString
    println(udid)
Popeye
  • 11,839
  • 9
  • 58
  • 91
Jared Messenger
  • 1,236
  • 1
  • 13
  • 14
  • -1 for the line `"There is a specific UDID that you can use called identifierForVendor"` Then you have under it `@property(nonatomic, readonly, retain) NSUUID *identifierForVendor` which clear says it's a `UUID` not a `UDID`. Also because `UDID` has been removed completely and not just deprecated. – Popeye Aug 05 '14 at 18:39
  • @popeye, can you please explain? I didn't want to confuse users with the IDFA (the UUID used by advertising companies), Edit - thanks for the clarification, good catch.. – Jared Messenger Aug 05 '14 at 18:42
  • What do you want me to explain? I have removed my -1 has you edit out, i had to edit your answer for me to remove so removed a `"."` – Popeye Aug 05 '14 at 18:44