This question already has answers here:
UIDevice uniqueIdentifier deprecated - What to do now?
                                
                                    (32个答案)
                                
                        
                        
                            How to get the UDID in iOS 6 and iOS 7 [duplicate]
                                
                                    (2个答案)
                                
                        
                                6年前关闭。
            
                    
我有一个解决方案

NSString *uid;
uid= [[UIDevice currentDevice] uniqueIdentifier];
NSLog(@"udid is %@",uid);


但是它向我显示“ uniqueIdentifier”已被弃用,并且可在iOS 5中使用。如何为iOS 6以编程方式获取UDID?

最佳答案

由于安全/隐私原因,UDID在iOS 6+中不再可用。而是使用identifierForVendor或advertisingIdentifier。

链接在这里
How to get the UDID in iOS 6 and iOS 7

10-08 05:47
查看更多