UIDevice uniqueIdentifier deprecated - What to do now?

后端 未结 30 2263
日久生厌
日久生厌 2020-11-21 06:07

It has just come to light that the UIDevice uniqueIdentifier property is deprecated in iOS 5 and unavailable in iOS 7 and above. No alternative method or pr

30条回答
  •  自闭症患者
    2020-11-21 06:28

    I had got some issue too, and solution is simple:

        // Get Bundle Info for Remote Registration (handy if you have more than one app)
        NSString *appName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
        NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
    
    
        // Get the users Device Model, Display Name, Unique ID, Token & Version Number
        UIDevice *dev = [UIDevice currentDevice];
        NSString *deviceUuid=[dev.identifierForVendor  UUIDString];
    
        NSString *deviceName = dev.name;
    

提交回复
热议问题