有没有办法识别iDevice用户? [英] Is there any way to identify an iDevice user?

查看:74
本文介绍了有没有办法识别iDevice用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个原生的iOS应用程序,我对于Objective-C和apple设备开发都是新手。



在我的应用程序中,我需要识别用户以独特的方式。我认为最好的解决方案是获取当前的Apple ID并将其存储在在线数据库中以用于我的目的。唯一的问题是用户可以更改它。所以,我认为Apple必须有另一个标识符来唯一区分实际账户。



有什么方法可以得到那个?我错过了什么?一些课程?



提前致谢...
Pete

解决方案

所有IOS设备都有唯一标识符UDID,可通过以下方式访问:

  [[UIDevice currentDevice] uniqueIdentifier] 

但是苹果不鼓励这样做,有些应用程序因使用它而被拒绝,主要是因为苹果没有希望您将设备跟踪或视为唯一设备,因为您可以将其出售或与其他人交换。



您可以做的是创建 UUID是一个唯一标识符并将其存储在密钥链,这意味着即使应用程序被删除,此唯一ID仍将保留在手机中,只有在您重置工厂时才会消失,这就是苹果想要的。



另一种解决方案是使用外部图书馆将在设备基础上生成uniqueID的es,如 openUDID UIDevice-with-UniqueIdentifier-for-iOS-5



<希望这有帮助!


I'm developing a native iOS app and I`m kind of newbie both to objective-C and apple device development.

In my app I need to identify the user by an unique way. I think that the best solution would be to obtain current Apple ID and store it in online database for my purposes. The only catch is that the user can change it. So, I`m thinking Apple has to have another identifier to uniquely distinguish the actual accounts.

Is there any way I can get that one? Something I missed? Some class?

Thanks in advance... Pete

解决方案

All IOS devices have and Unique identifier UDID, wich is accesible through:

[[UIDevice currentDevice] uniqueIdentifier]

But this is discouraged by Apple and some apps are getting rejected by using this, basically because apple doesn't want you to track or treat devices as unique, because you can sell it or swap it with another person.

What you can do is to create a UUID which is a unique identifier and store it in the key chain, which means that this uniqueID will remain in the phone even if the app is deleted, it will only disappear when the you do a factory reset, which is what apple wants.

Another solution is to use external libraries that will generate uniqueID on a device basis like openUDID or UIDevice-with-UniqueIdentifier-for-iOS-5

Hope this helps!

这篇关于有没有办法识别iDevice用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆