我SSKeychain
用于存储设备的 UUID。但是,有时SSKeychain
不保留 UUID,因此我的应用必须重新创建新的 UUID。有人可以告诉我一些为什么SSKeychain
不保留数据的原因。
提前致谢!
对不起我的英语不好 :)
我SSKeychain
用于存储设备的 UUID。但是,有时SSKeychain
不保留 UUID,因此我的应用必须重新创建新的 UUID。有人可以告诉我一些为什么SSKeychain
不保留数据的原因。
提前致谢!
对不起我的英语不好 :)
在你的目标 C 的 appdelegates 中试试这个
NSString *uniqueId = [SSKeychain passwordForService:@"YOUR_PROJECT_IDENTIFIER" account:@"unique_id"];
if ([uniqueId length]==0)
{
uniqueId = [AppDelegate uuid];
[SSKeychain setPassword:uniqueId forService:@"Store credentials in Keychain Identifier" account:@"unique_id"];
}
[[NSUserDefaults standardUserDefaults] setValue:uniqueId forKey:@"iPhoneUniqueID"];
NSLog(@"Device_ID:%@",uniqueId);