獲取iOS設(shè)備的相關(guān)信息

NSString *ssid = @"Not Found";

NSString *macIp = @"Not Found";

// ? ?BA5DC546-E961-44B0-85FA-D5CD4C39BF57

// ? 4B9E7471-EF79-4EF5-AEA8-C700CC6D7039

CFUUIDRef puuid = CFUUIDCreate( nil );

CFStringRef uuidString = CFUUIDCreateString( nil, puuid );

NSString * result = (NSString *)CFBridgingRelease(CFStringCreateCopy( NULL, uuidString));

NSLog(@"%@",result);

// ? ?And to use it

CLBeaconRegion *_myBeaconRegion;

NSDictionary *myBeaconData = [_myBeaconRegion peripheralDataWithMeasuredPower:nil];

NSLog(@"%@",myBeaconData);

NSString *identifierForVendor = [[UIDevice currentDevice].identifierForVendor UUIDString];

// ? ?NSString *identifierForAdvertising = [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];

//設(shè)備相關(guān)信息的獲取

NSLog(@"%@",identifierForVendor);

NSString *strName = [[UIDevice currentDevice] name];

NSLog(@"設(shè)備名稱:%@", strName);//e.g. "My iPhone"

NSString *strId = [[UIDevice currentDevice] identifierForVendor];

NSLog(@"設(shè)備唯一標(biāo)識:%@", strId);//UUID,5.0后不可用

NSString *strSysName = [[UIDevice currentDevice] systemName];

NSLog(@"系統(tǒng)名稱:%@", strSysName);// e.g. @"iOS"

NSString *strSysVersion = [[UIDevice currentDevice] systemVersion];

NSLog(@"系統(tǒng)版本號:%@", strSysVersion);// e.g. @"4.0"

NSString *strModel = [[UIDevice currentDevice] model];

NSLog(@"設(shè)備模式:%@", strModel);// e.g. @"iPhone", @"iPod touch"

NSString *strLocModel = [[UIDevice currentDevice] localizedModel];

NSLog(@"本地設(shè)備模式:%@", strLocModel);// localized version of model

CFArrayRef myArray = CNCopySupportedInterfaces();

NSLog(@"%@",myArray);

// ? ?80:89:17:31:4b:52

// ? ?94:b4:f:6f:65:80

if (myArray != nil) {

CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));

if (myDict != nil) {

NSDictionary *dict = (NSDictionary*)CFBridgingRelease(myDict);

NSLog(@"%@",dict);

ssid = [dict valueForKey:@"SSID"];

macIp = [dict valueForKey:@"BSSID"];

NSDictionary *ssidData = [dict valueForKey:@"SSIDDATA"];

NSLog(@"......%d",ssidData.count);

}

}

NSLog(@"ssid>>>%@,macIp---->>%@",ssid,macIp);

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容