As UDID has been deprecated are their any alternative ways for UDID?
Asked
Active
Viewed 2,205 times
-3
-
for what purpose are you using – Naresh Apr 10 '13 at 04:39
-
1As you type in a question, SO offers you a list of possible related questions. Please review those before posting your question. This avoids duplicates. – rmaddy Apr 10 '13 at 04:45
-
Here's a lib might helps: https://github.com/Kjuly/UIApplication-UIID – Kjuly Apr 10 '13 at 04:47
-
If it is declared a duplicate, then the duplicate has to be cross-referenced. – mobibob Aug 11 '13 at 00:14
2 Answers
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