preparing自己 - 到设备UDID的替代 [英] An alternative to the device UDID - preparing ourselves

查看:159
本文介绍了preparing自己 - 到设备UDID的替代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  <一href=\"http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-de$p$pcated-what-to-do-now\">UIDevice UNIQUEIDENTIFIER德precated - 什么现在要做的

我知道已经有相当多的问题,在SO这一点,但我认为,因为苹果正在提前,积极否认使用UDID的应用程序(的http://pulse.me/s/7mzKE ),我们的开发人员需要采取积极的态度和大量讨论这个问题。

I know there have been quite a few questions on SO about this, but I think that because Apple is moving ahead of schedule and actively denying applications that make use of UDIDs (http://pulse.me/s/7mzKE), us developers need to take an active approach and discuss this matter in bulk.

所以,问题是 - 什么是唯一的设备标识一个良好的,稳定的和正确的选择,要比访问它的UDID其他财产?

So the question is - what is a good, stable and correct alternative for unique device identification, other than accessing it's UDID property?

推荐答案

这取决于你的需要...如果你正在寻找您的应用程序使用一个简单的设备标识符,然后在去$ P $的文档pcated UNIQUEIDENTIFIER 方法pretty多提供你的答案:

This depends on your needs...if you're looking for a simple device identifier for your application to use, then the documentation on the deprecated uniqueIdentifier method pretty much provides your answer:

不要使用唯一标识符属性。要创建特定的唯一标识符到您的应用程序,你可以调用 CFUUIDCreate 函数来创建一个UUID,并用它写入默认数据库 NSUserDefaults的类。

Do not use the uniqueIdentifier property. To create a unique identifier specific to your app, you can call the CFUUIDCreate function to create a UUID, and write it to the defaults database using the NSUserDefaults class.

CFUUIDCreate 将返回一个唯一的标识符,手机是唯一的应用程序。你需要将其存储在 NSUserDefaults的,因为它的将改变的,如果你做后续调用。对于大多数使用此就足够了,这并不是因为如果苹果公司没有提供这种变化足够的警告(的iOS 5已经出来了半年多了,现在,更长的开发者文档)。

CFUUIDCreate will return a unique handset identifier that is unique to your application. You need to store it in NSUserDefaults because it will change if you make subsequent calls. For most uses this will suffice, and it's not as if Apple didn't provide enough warning of this change (iOS 5 has been out for over six months now, and the developer docs for longer).

其他的情形是,你需要在应用程序(例如,移动广告网络)共享您的设备标识符。这是一个比较复杂的问题,有一些替代方案(也不能保证他们会在未来保持周围:苹果公司的主要理由去precating的UDID API是presumably到的停止跨应用程序的用户跟踪)。

The other scenario is where you need to share your device identifier across applications (ie, mobile advertising networks). That's a more complex problem, with a number of alternative options (there's also no guarantee they'll remain around in the future: Apple's primary reason for deprecating the UDID API is presumably to stop cross application user tracking).

这篇关于preparing自己 - 到设备UDID的替代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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