-3

As UDID has been deprecated are their any alternative ways for UDID?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
user2260521
  • 65
  • 2
  • 6

2 Answers2

1

You can use the following thing as a unique Identifier for your app user's :

I use the method below to create a UUID and save it to the user preferences the first time the app is started:

- (NSString *)getUUID
{
    NSString *UUID = [[NSUserDefaults standardUserDefaults] objectForKey:@"uniqueID"];
    if (!UUID)
    {
        CFUUIDRef theUUID = CFUUIDCreate(NULL);
        CFStringRef string = CFUUIDCreateString(NULL, theUUID);
        CFRelease(theUUID);
        UUID = [(__bridge NSString*)string stringByReplacingOccurrencesOfString:@"-"withString:@""];
        [[NSUserDefaults standardUserDefaults] setValue:UUID forKey:@"uniqueID"];
    }
    return UUID;
}

Hope that helps !

Rajan Balana
  • 3,775
  • 25
  • 42
1

Apple stopped supporting a unique identifier for iOS. This source code solves the problem. It generates a unique identifier based on the mac address of the device in combination with the bundle identifier.

Please download the demo http://bit.ly/10SXhrO

Hiren
  • 12,720
  • 7
  • 52
  • 72