1. 程式人生 > >iOS 獲取裝置相關資訊

iOS 獲取裝置相關資訊

//裝置相關資訊的獲取
    NSString *IMEI = (NSString *)[[UIDevice currentDevice] identifierForVendor];
    NSLog(@"裝置唯一標識:%@", IMEI);//UUID,5.0後不可用

    NSString *osVersion = [[UIDevice currentDevice] systemVersion];
    NSLog(@"系統版本號:%@", osVersion);// e.g. @"4.0"

    NSString* clientModel = [[UIDevice currentDevice] model];
    NSLog
(@"手機型號: %@",clientModel); //手機型號 NSString * appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; NSLog(@"App應用版本:%@", appVersion); // 請求時間 NSDate * nowDate = [NSDate date]; NSInteger nowInterval = [nowDate timeIntervalSince1970]; nowInterval = nowInterval + 8
* 3600; NSString * reqTime = [NSString stringWithFormat:@"%ld",(long)nowInterval]; NSLog(@"請求時間:%@", reqTime);
2016-03-08 11:17:41.236 MD5[1612:60b] 裝置唯一標識:<__NSConcreteUUID 0x17da75e0> 3F7ADBB0-D4A5-4923-99ED-71D782CFE085
2016-03-08 11:17:41.239 MD5[1612:60b] 系統版本號:7.1.2
2016-03-08 11:17:41.243 MD5
[1612:60b] 手機型號: iPhone 2016-03-08 11:17:41.247 MD5[1612:60b] App應用版本:1.0 2016-03-08 11:17:41.250 MD5[1612:60b] 請求時間:1457435861