Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need to identify each iPhone user in my database application uniquely. What code would achieve this?

I know each iPhone has a electronic identifier other than the phone # or ESN - how do I call it and what does it return?

like image 257
JMeringer Avatar asked Nov 27 '08 15:11

JMeringer


2 Answers

The UIDevice class contains the information you need.

[[UIDevice currentDevice] uniqueIdentifier]

like image 82
Rob Drimmie Avatar answered Sep 19 '22 18:09

Rob Drimmie


If you need security, then you probably can't use the device's built-in unique identifier, because one could easily spoof this information. I'm just guessing here, but, most likely, from your server's perspective there's an incoming connection/request that contains the phone's ID. Now, how can you be really sure the connection/request is actually coming from the iPhone with that ID?

One solution is to issue each new device that connects to your server with a unique ID of your own in a secure way (i.e., the ID can't be obtained by a third party). You then need to use a secure protocol whereby a connection/request proves to your server that it originated from a device that knows the above ID.

like image 42
Alexander Avatar answered Sep 21 '22 18:09

Alexander