獲取設備uuid
NSString *vendor = [[UIDevice currentDevice].identifierForVendor UUIDString];
當通常我們如果app重裝之後uuid會改變,所以我們需要把它保存在鑰匙串內
NSString * deviceVendor = [[GSKeychain systemKeychain]secretForKey:@"XXX"]; //xxx表示是工程名稱 從鑰匙串中讀取uuid
if(!deviceVendor)
{
[[GSKeychain systemKeychain]setSecret:vendor forKey:@"XXX"];
deviceVendor = [[GSKeychain systemKeychain]secretForKey:@"XXX"];
NSLog(@"shareVC保存vendor:%@",deviceVendor);
}
else
{
NSLog(@"shareVC獲取vendor:%@",deviceVendor);
}