我需要一个使用Xcode 6.1(iOS 8.1)内置应用程序的每个设备的唯一ID。
我已将identifierForVendor
用于iOS 6或更高版本的设备。但是,该应用程序还旨在支持iOS 5或更早版本的设备。所以我做的是
if ([[UIDevice currentDevice]respondsToSelector:@selector(identifierForVendor)]) {
return [UIDevice currentDevice].identifierForVendor.UUIDString;
}
else{
return [[UIDevice currentDevice] performSelector:@selector(uniqueIdentifier)];
}
但有些帖子如this和this表示,如果调用uniqueIdentifier
方法,Apple会拒绝该帖子。
如果是这种情况,那么有人可以指导我如何做到这一点吗?
感谢。