我希望通过编程获取iPhone的UUID,并将其存储在我的数据库中。
我能否使用UUID来检查应用是否已购买?
如何获取它?
我希望通过编程获取iPhone的UUID,并将其存储在我的数据库中。
我能否使用UUID来检查应用是否已购买?
如何获取它?
NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];
在文档中搜索“UDID”,只需要五秒钟就能找到。
不,你不能从UDID收集信息。
有关UDID的更多信息,请查看UIDevice
文档。通常情况下,应该很少使用仅UDID,因为设备可以传递给具有不同iTunes帐户的不同人。
尝试使用以下代码:
UIDevice *device = [UIDevice currentDevice];
NSString *uniqueIdentifier = [device uniqueIdentifier];
NSString *uuid = [[UIDevice currentDevice] uniqueIdentifier];
NSString * UDID = [[UIDevice currentDevice] uniqueIdentifier];
UDID = [UDID stringByReplacingOccurrencesOfString:@"-" withString:@""];