获取手机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);




posted @ 2012-03-13 20:14  FoxBabe  阅读(2945)  评论(0编辑  收藏  举报