How to use UUID when programming on iphone?

I want to get the UUID of iphone by programming, and also want to save it in my database.

Can I use a UUID to check if an app was purchased or not?

How can i get it?

+3
source share
4 answers
NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];

Took five seconds to find with the search "UDID" in the docs.

No, you cannot collect information from UDID.

See the docs UIDevicefor more information about UDIDs. In general, only UDIDs should be rarely used, since devices can be transferred to others with different iTunes accounts.

+7
source

try this code:

UIDevice *device = [UIDevice currentDevice];
NSString *uniqueIdentifier = [device uniqueIdentifier];
+2
source

Use below

   NSString *uuid = [[UIDevice currentDevice] uniqueIdentifier];
+1
source
NSString * UDID = [[UIDevice currentDevice] uniqueIdentifier];
UDID = [UDID stringByReplacingOccurrencesOfString:@"-" withString:@""];
0
source

All Articles