更新时间:2023-12-04 13:44:52
如果继续使用 uniqueIdentifier
独立于iOS版本。我建议使用 OpenUDID ,这是已弃用的 uniqueIdentifier的替代品。
。
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
.
您可以检查 identifierForVendor
是否可用,或者您可以使用OpenUDID所有情况。
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];
}