我需要唯一地识别我的数据库应用程序中的每个iPhone用户。什么代码会实现这个目标?

时间:2022-01-20 08:35:43

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

我知道每个iPhone都有一个除电话号码或ESN之外的电子标识符 - 我该如何调用它以及它返回什么?

3 个解决方案

#1


9  

The UIDevice class contains the information you need.

UIDevice类包含您需要的信息。

[[UIDevice currentDevice] uniqueIdentifier]

[[UIDevice currentDevice] uniqueIdentifier]

#2


2  

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?

如果您需要安全性,那么您可能无法使用设备的内置唯一标识符,因为人们很容易欺骗这些信息。我只是在这里猜测,但是,很可能,从您的服务器的角度来看,有一个包含电话ID的传入连接/请求。现在,您如何确定连接/请求实际来自具有该ID的iPhone?

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.

一种解决方案是以安全的方式发布使用您自己的唯一ID连接到您的服务器的每个新设备(即,第三方无法获取该ID)。然后,您需要使用安全协议,通过该协议,连接/请求向您的服务器证明它来自知道上述ID的设备。

#3


-2  

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

如果您正在编写Web应用程序,为什么不使用标准Cookie?

#1


9  

The UIDevice class contains the information you need.

UIDevice类包含您需要的信息。

[[UIDevice currentDevice] uniqueIdentifier]

[[UIDevice currentDevice] uniqueIdentifier]

#2


2  

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?

如果您需要安全性,那么您可能无法使用设备的内置唯一标识符,因为人们很容易欺骗这些信息。我只是在这里猜测,但是,很可能,从您的服务器的角度来看,有一个包含电话ID的传入连接/请求。现在,您如何确定连接/请求实际来自具有该ID的iPhone?

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.

一种解决方案是以安全的方式发布使用您自己的唯一ID连接到您的服务器的每个新设备(即,第三方无法获取该ID)。然后,您需要使用安全协议,通过该协议,连接/请求向您的服务器证明它来自知道上述ID的设备。

#3


-2  

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

如果您正在编写Web应用程序,为什么不使用标准Cookie?