What to do with apps running on iOS 5 and below for identifierForVender

天涯浪子 提交于 2019-12-03 22:40:43

问题


I have heard over the last couple of days that Apple are making it so that apps that use the UDID identifier of the device that they are running on will be rejected from the Apple App store (Here is where I have read this). They advise developers to use the identifierForVender which was introduced in iOS 6. I don't have an issue with this easy to change over, but what do I use if I still want to support devices running on an iOS below iOS6? Can I still use the UDID identifier or not? I don't believe this is very clear.


回答1:


Your app will be rejected if you continue to use uniqueIdentifier independently of the iOS version. I recommend using OpenUDID instead, which is a drop-in replacement for the deprecated uniqueIdentifier.

You could check whether identifierForVendor is available, or you can use OpenUDID in all cases.

if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) {
    // Use: [[[UIDevice currentDevice] identifierForVendor] UUIDString];
} else {
    // Use: [OpenUDID value];
}


来源:https://stackoverflow.com/questions/15614903/what-to-do-with-apps-running-on-ios-5-and-below-for-identifierforvender

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!