How to fnd UUID by programming in iphone?
I want to fetch UUID of ip开发者_开发百科hone by programming and also want to store it in my database.
Can I use UUID to check whether the app is purchased or not ?
How can I get it ?
NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];
Took five seconds to find with a search for "UDID" in the docs.
No, you cannot gather information from the UDID.
Check the UIDevice
docs for more information about the UDID. In general, the UDID alone should be used rarely, as devices can be passed on to different persons with different iTunes accounts.
try this code:
UIDevice *device = [UIDevice currentDevice];
NSString *uniqueIdentifier = [device uniqueIdentifier];
Use below
NSString *uuid = [[UIDevice currentDevice] uniqueIdentifier];
NSString * UDID = [[UIDevice currentDevice] uniqueIdentifier];
UDID = [UDID stringByReplacingOccurrencesOfString:@"-" withString:@""];
精彩评论