适用于iOS6或更高版本的identifierForVendor。如何从同一个应用程序中识别iOS5或更早版本的设备?

时间:2014-12-04 10:52:48

标签: ios uidevice

我需要一个使用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)];
}

但有些帖子如thisthis表示,如果调用uniqueIdentifier方法,Apple会拒绝该帖子。

如果是这种情况,那么有人可以指导我如何做到这一点吗?

感谢。

0 个答案:

没有答案