[英]Keep track of an iOS Device even after phone is wiped
I have been looking at ways to uniquely identify an iOS device and making sure that our app is being used on the same device as was before phone was wiped. 我一直在研究如何唯一地识别iOS设备,并确保我们的应用程序在手机被擦除之前的同一设备上使用。
I know that querying for UDID has been deprecated and that there is a new method to map a device to the app: CFUUID but the problem with that approach is this UUID given by CFUUID is different on every new install of the app. 我知道查询UDID已被弃用,并且有一种新方法将设备映射到应用程序: CFUUID但该方法的问题是CFUUID给出的这个UUID在应用程序的每次新安装时都是不同的。
EDIT: Actually I meant 编辑:其实我的意思
[[UIDevice currentDevice] identifierForVendor] [[UIDevice currentDevice] identifierForVendor]
and not CFUUID. 而不是CFUUID。 Sorry for this, I was referring to this identifierForVendor which is different for each time the app is uninstalled. 对不起,我指的是这个identifierForVendor,每次卸载应用程序时都不同。 This is what I don't want in the app. 这是我在应用程序中不想要的。 There must be a way because I wiped my phone and Testflight was able to identify it as the same device. 必须有一种方法,因为我擦了我的手机,Testflight能够将它识别为同一设备。 I want to know how they could have done it. 我想知道他们怎么做到的。
Services like testflight and maybe all analytics services are still being able to uniquely identify devices and users even after querying MAC address (which now returns the same number for all devices) and UDID has been deprecated. 即使在查询MAC地址(现在为所有设备返回相同的数字)并且不推荐使用UDID之后,testflight等服务以及所有分析服务仍然能够唯一地识别设备和用户。 Can someone tell me a mechanism to uniquely identify an iOS device such that it can be identified even after a phone wipe. 有人可以告诉我一种唯一识别iOS设备的机制,即使在手机擦除后也可以识别它。
I have looked into Apple OTA Configuration but I am not sure if that can help somehow track only the device and not sending back any provisioning profiles for users that log-in to our service. 我已经研究过Apple OTA配置,但我不确定这是否可以帮助以某种方式仅跟踪设备,而不是为登录我们服务的用户发回任何配置文件。
There is no sanctioned, publicly accessible API for what you want on iOS 7. 在iOS 7上没有您想要的制裁,可公开访问的API。
The closest option to what you are looking for is 您正在寻找的最接近的选择是
[[UIDevice currentDevice] identifierForVendor]
From Apple's docs: 来自Apple的文档:
The value of this property is the same for apps that come from the same vendor running on the same device. 对于来自同一设备上运行的同一供应商的应用,此属性的值相同。 A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor. 对于来自不同供应商的同一设备上的应用程序以及不同供应商的不同设备上的应用程序,将返回不同的值。
The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. 在iOS设备上安装app(或来自同一供应商的其他应用程序)时,此属性中的值保持不变。 The value changes when the user deletes all of that vendor's apps from the device and subsequently reinstalls one or more of them. 当用户从设备中删除所有该供应商的应用程序并随后重新安装其中一个或多个应用程序时,该值会更改。
For better or for worse Apple has deprecated just about anything that could help here (and will reject your app from the AppStore if you try workarounds, though perhaps you are not planning on App Store distribution). 无论好坏,Apple已经弃用了任何可能有用的东西(如果您尝试解决方法,将拒绝AppStore上的应用程序,尽管您可能没有计划App Store分发)。 Their rationale is that users should be able to replace/upgrade phones at will and as long as their Apple ID remains constant they get to keep using whatever assets they had before. 他们的理由是,用户应该可以随意更换/升级手机,只要他们的Apple ID保持不变,他们就可以继续使用他们以前拥有的任何资产。
Of course I can imagine cases where their logic is flawed and the device matters, but it's not up to me... 当然,我可以想象一下他们的逻辑存在缺陷并且设备很重要的情况,但这并不取决于我......
Is there no way you can tie things to a user login rather than a device? 你有没有办法把东西绑定到用户登录而不是设备? If not, what you could do is generate and store a random number on the device one time. 如果没有,您可以做的是在设备上生成并存储一次随机数。
There are no public (ie approved by Apple) ways to identify device across wipes. 没有公开(即Apple批准)的方法来识别擦除设备。 Both identifierForVendor
and advertisingIdentifier
will change if device is wiped/restored. 如果擦除/恢复设备,则identifierForVendor
和advertisingIdentifier
都将更改。
Services like TestFlight are able to identify devices because they install special configuration profiles that give some extra abilities to them, such as getting actual UDID. 像TestFlight这样的服务能够识别设备,因为它们安装了特殊的配置文件 ,为它们提供了一些额外的功能,例如获取实际的UDID。
If you're not targeting AppStore (ie trying to do this from AdHoc app or on jailbroken device) then there are ways to achieve this with private APIs. 如果您没有针对AppStore(即尝试从AdHoc应用程序或越狱设备执行此操作),那么有很多方法可以通过私有API实现此目的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.