ios iOS6 UDID - identifierForVendor 比 identifierForAdvertising 有什么优势?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11836225/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iOS6 UDID - What advantages does identifierForVendor have over identifierForAdvertising?
提问by Tihom
Apple is changing their privacy settings for iOS6 and deprecating device UUIDs (UDIDs). According to a WWDC presentation and the docs there are two replacements for the UDIDs, both in the UIDevice
class:
Apple 正在更改 iOS6 的隐私设置并弃用设备 UUID (UDID)。根据 WWDC 演示文稿和文档,UDID 有两个替代品,均在UIDevice
类中:
-identifierForVendor
-identifierForVendor
- ID that is identical between apps from the same developer.
- Erased with removal of the last app for that Team ID.
- Backed up.
- 来自同一开发者的应用程序之间的 ID 相同。
- 删除该团队 ID 的最后一个应用程序。
- 备份。
-identifierForAdvertising
-identifierForAdvertising
- Unique to the device.
- Available to all applications; used for advertising — iAd has converted from UDID for iOS 6 and later.
- Reset with "Erase All Content & Settings".
- Backed up.
- 设备独有。
- 适用于所有应用程序;用于广告 — iAd 已从 iOS 6 及更高版本的 UDID 转换而来。
- 使用“删除所有内容和设置”重置。
- 备份。
It seems to me that -identifierForVendor
is inferior to -identifierForAdvertising
since it would get reset on last uninstall of an app from a vendor and by "erase all contents & settings".
在我看来,这-identifierForVendor
不如,-identifierForAdvertising
因为它会在上次从供应商处卸载应用程序并通过“擦除所有内容和设置”进行重置。
What advantages does -identifierForVendor
have over -identifierForAdvertising
?
没有什么优势-identifierForVendor
有过-identifierForAdvertising
?
采纳答案by JRG-Developer
Important Note:
重要说明:
Apple just released iOS 6.0 and the NDA has been lifted.
Apple 刚刚发布了 iOS 6.0,并且 NDA 已经取消。
For developers who preemptively included code that referenced
对于抢先包含引用的代码的开发人员
[[UIDevice currentDevice] identifierForAdvertising]
this method has NOTbeen included on iOS 6. If you use the above method, your app will (most likely) crash and be rejected!
这种方法已经不被列入在iOS 6.如果你使用上面的方法,您的应用(最有可能)崩溃和被拒绝!
Instead, Apple has created a new class ASIdentifierManager
, which includes the method advertisingIdentifier
. Here's the apple docson it:
相反,苹果创造了一个新的类ASIdentifierManager
,其中包括方法advertisingIdentifier
。这是苹果的文档:
回答by Mr. T
Users can limit the use of ad tracking on their phone. See this article on the opt-out mechanismunder Settings > General > About > Advertising.
用户可以限制在手机上使用广告跟踪。请参阅有关“设置”>“常规”>“关于”>“广告”下的选择退出机制的文章。
The new ASIdentifierManager
class has a property advertisingTrackingEnabled
, which returns true or false depending if the user has limited ad tracking. Even though the device's advertising identifier is returned by the advertisingIdentifier
property regardless of opt-out, you aren't supposed to use the identifier if the user has opted-out.
新ASIdentifierManager
类有一个属性advertisingTrackingEnabled
,它返回 true 或 false,具体取决于用户的广告跟踪是否有限。即使设备的广告标识符由advertisingIdentifier
属性返回而不管选择退出,如果用户选择退出,您也不应该使用该标识符。
So the advantage of identifierForVendor is that you'll always have access to and the right to use this id for the phone regardless of user's opt-in or opt-out for advertising tracking.
因此,identifierForVendor 的优势在于,无论用户选择加入还是选择退出广告跟踪,您始终可以访问并有权在手机上使用此 ID。
回答by Ole Begemann
I suspect that Apple will simply reject your app if you use identifierForAdvertising
for anything that is not advertising-related (i.e., if you send the identifierForAdvertising
to your own servers even though you're not an advertising network or if you send the identifierForAdvertising
in the same request with other data that could potentially identify an individual).
我怀疑如果您将应用程序identifierForAdvertising
用于与广告无关的任何内容(即,如果您将应用程序发送identifierForAdvertising
到您自己的服务器,即使您不是广告网络,或者如果您identifierForAdvertising
在同一请求中发送其他可能识别个人身份的数据)。
If my suspicion is correct, the advantage of identifierForVendor
over identifierForAdvertising
is that it won't get your app rejected.
如果我的怀疑是正确的,那么identifierForVendor
over的好处identifierForAdvertising
是它不会让您的应用程序被拒绝。
回答by g_low
They are two different ids meant for two different purposes.
I would think that the identifierForVendor would be the one to use to do things that require the app linking to a specific user / device such as provide push notifications and updating the user's app data serverside (like their score or whatever other data is being stored for them).
The identifierForAdvertising should be used for things such as targeted advertising and also to check the effectiveness of a particular ad campaign (check to see which devices installed apps due to a particular ad).
它们是两个不同的 ID,用于两个不同的目的。我认为 identifierForVendor 将用于做需要应用程序链接到特定用户/设备的事情,例如提供推送通知和更新用户的应用程序数据服务器端(如他们的分数或任何其他数据被存储他们)。
identifierForAdvertising 应该用于诸如定向广告之类的事情,还可以检查特定广告活动的有效性(检查哪些设备因特定广告安装了应用程序)。
回答by idiogo
Use the VendorID. This is a very enlightening article http://www.doubleencore.com/2013/04/unique-identifiers/
使用VendorID。这是一篇很有启发性的文章http://www.doubleencore.com/2013/04/unique-identifiers/
回答by Denis Kutlubaev
To create a uniqueString based on unique identifier of device in iOS 6:
在 iOS 6 中根据设备的唯一标识符创建一个 uniqueString:
#import <AdSupport/ASIdentifierManager.h>
NSString *uniqueString = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
NSLog(@"uniqueString: %@", uniqueString);
回答by Gustav
identifierForAdvertising
is probably superior in terms of tracking but might be subject to present or future opt-out by the user. On the other hand identifierForVendor
is not as likely to be subject of the user.
identifierForAdvertising
在跟踪方面可能更胜一筹,但可能会受到用户当前或将来选择退出的影响。另一方面identifierForVendor
不太可能成为用户的主题。
回答by Hrissan
Those APIs are so badly designed, that clearly says - Apple does not want us to identify user devices.
这些 API 的设计非常糟糕,这清楚地表明 - Apple 不希望我们识别用户设备。
Just look at the identifierForVendor description.
只需查看 identifierForVendor 描述。
It is erased if the user erases all apps from the same vendor. :( It is not reliable - can return nil (documentation advices to "wait" for some time if this happens. :(
如果用户删除了来自同一供应商的所有应用程序,它就会被删除。:(这是不可靠的 - 可以返回零(文件建议以“等待”一些时间,如果发生这种情况:(。
They did not use obvious solution, which works anytime and does not rely on installs/removes - return SHA-1 (or any other hash) of internal hardware device id concatenated with Team ID.
他们没有使用明显的解决方案,该解决方案随时可用,不依赖于安装/删除 - 返回与团队 ID 连接的内部硬件设备 ID 的 SHA-1(或任何其他哈希)。
回答by malhal
The important thing to know is that the backup of the identifierForVendor can only be restored to the same device. If the backup is restored to a difference device the identifier is cleared.
要知道的重要一点是,identifierForVendor 的备份只能恢复到同一设备。如果备份恢复到不同的设备,则清除标识符。
回答by Igor
User can change identifierForAdvertising any time in Settings, identifierForVendor changes after reinstall app, if no more apps on device from this vendor.
用户可以随时在“设置”中更改 identifierForAdvertising,如果设备上没有来自该供应商的更多应用,则在重新安装应用程序后,identifierForVendor 会更改。
Here is alternative and the best solution for get or persistent, cross-install Device Identifier:
以下是获取或持久、交叉安装设备标识符的替代和最佳解决方案:
description: https://blog.onliquid.com/persistent-device-unique-identifier-ios-keychain/
描述:https: //blog.onliquid.com/persistent-device-unique-identifier-ios-keychain/
code: https://gist.github.com/miguelcma/e8f291e54b025815ca46