Groups
Groups
Sign in
Groups
Groups
Easy APNs
Conversations
About
Send feedback
Help
UUID
292 views
Skip to first unread message
svenj...@googlemail.com
unread,
Nov 14, 2013, 5:30:52 PM
11/14/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to easy...@googlegroups.com
Hi everyone,
can someone help me on this? I would like to get a UUID for devices from IOS 5 and later. Who can help me
with the code? Is it correct like this?
UIDevice *dev = [UIDevice currentDevice];
NSString *deviceUuid;
if ([dev respondsToSelector:@selector(identifierForVendor)])
deviceUuid = dev.identifierForVendor.UUIDString;
else {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
id uuid = [defaults objectForKey:@"deviceUuid"];
if (uuid)
deviceUuid = (NSString *)uuid;
else {
CFStringRef cfUuid = CFUUIDCreateString(NULL, CFUUIDCreate(NULL));
deviceUuid = (__bridge NSString *)cfUuid;
CFRelease(cfUuid);
[defaults setObject:deviceUuid forKey:@"deviceUuid"];
}
}
Reply all
Reply to author
Forward
0 new messages