iOS 获取设备-语言,版本,国家
2017-09-27 本文已影响73人
887d1fc86fe6
/// 当前设备
UIDevice*currentDevice = [UIDevice currentDevice];
/// 数据模型
NSString*model = [currentDevice model];
/// 系统版本
NSString*systemVersion = [currentDevice systemVersion];
/// 当前手机使用的语言数组
NSArray*languageArray = [NSLocale preferredLanguages];
/// 语言
NSString*language = [languageArray objectAtIndex:0];
/// 国家
NSLocale*locale = [NSLocale currentLocale];
NSString*country = [locale localeIdentifier];
/// 版本
NSString*appVersion = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey];
NSString*deviceSpecs = [NSStringstringWithFormat:@"%@ - %@ - %@ - %@ - %@", model, systemVersion, language, country, appVersion];
NSLog(@"Device Specs --> %@",deviceSpecs);