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];
//設備相關信息的獲取
NSLog(@"%@",identifierForVendor);
NSString *strName = [[UIDevice currentDevice] name];
NSLog(@"設備名稱:%@", strName);//e.g. "My iPhone"
NSString *strId = [[UIDevice currentDevice] identifierForVendor];
NSLog(@"設備唯一標識:%@", 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(@"設備模式:%@", strModel);// e.g. @"iPhone", @"iPod touch"
NSString *strLocModel = [[UIDevice currentDevice] localizedModel];
NSLog(@"本地設備模式:%@", 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);