views:

848

answers:

3

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

+9  A: 

The UIDevice class contains the information you need.

[[UIDevice currentDevice] uniqueIdentifier]

Rob Drimmie
+1  A: 

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.

Alexander
A: 

if you are writing a web app, why don't you use standard cookies?

Andreas Petersson