获取手机IMEI和UID
前期尝试过私有API,但是没有成功,还是用下面这个方法吧!
获取IMEI:
1 UIDevice *myDevice = [[UIDevice alloc] init];
2
3 NSString *myimei = [myDevice imei];
4
5 if (myimei.length!=15) {
6 myimei = @"0000000000000000";
7 }
获取UID:
UIDevice *device = [UIDevice currentDevice];//创建设备对象
NSString *deviceUID = [[NSString alloc] initWithString:[device uniqueIdentifier]];
NSLog(@"%@",deviceUID);