简体   繁体   English

ios IDFV存储在钥匙串中

[英]ios IDFV store in Keychain

i need Device ID which never change, i try UDID but is not available in IOS 6/7/8 so , i try With IDFV I've store IDFV in keychain which same after uninstalling app 我需要永不更改的设备ID ,我尝试使用UDID,但在IOS 6/7/8中不可用,所以,我尝试使用IDFVIDFV存储在钥匙串中,卸载应用程序后相同

   NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

stored that idfv to the Keychain using SSKeyChain 使用SSKeyChainidfv存储到钥匙串

When I "Reset content and settings" all stored data in keychain is deleted, and create new IDFV . 当我“重置内容和设置”时,将删除钥匙串中的所有存储数据,并创建新的IDFV I am new in IOS So I don't know how and where store my string which save my ID permanently. 我是IOS的新手,所以我不知道将字符串永久保存到ID的方式和位置。

You don't, Apple made sure that what you want is not possible, no accessible UDID, MAC address or any other unique device identifiers are available thru the official iOS SDK. 您没有,Apple确保无法实现所需的功能,通过官方的iOS SDK无法获得可访问的UDID,MAC地址或任何其他唯一的设备标识符。 Storing an unique identifier in the keychain is your only option. 在钥匙串中存储唯一标识符是您唯一的选择。

Create UUID with the help of NSUUID and store it in the keychain. NSUUID的帮助下创建UUID并将其存储在钥匙串中。


But the main question is why do you want to identify the device, even after the app is uninstalled. 但是主要的问题是,即使卸载了该应用程序,您为什么也要标识该设备。 There should be no need for it. 应该没有必要了。 If you are going to identify the user by this unique identifier then you will run into a lot of issue later on. 如果您要通过此唯一标识符来识别用户,则稍后会遇到很多问题。 Just take in mind that if the user sells it's device and the new user installs the same app the user will identified as the previous owner. 请记住,如果用户出售其设备,而新用户安装了相同的应用程序,则该用户将被标识为先前的所有者。 Since the device identifier did not change, I've had this happen with some apps. 由于设备标识符没有更改,因此我在某些应用程序中会发生这种情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM