IOS 獲取用戶手機基本信息的小技巧

  1. //手機序列號  

  2.    NSString* identifierNumber = [[UIDevice currentDevice] uniqueIdentifier];  

  3.    NSLog(@"手機序列號: %@",identifierNumber);  

  4.    //手機別名: 用戶定義的名稱  

  5.    NSString* userPhoneName = [[UIDevice currentDevice] name];  

  6.    NSLog(@"手機別名: %@", userPhoneName);  

  7.    //設備名稱  

  8.    NSString* deviceName = [[UIDevice currentDevice] systemName];  

  9.    NSLog(@"設備名稱: %@",deviceName );  

  10.    //手機系統版本  

  11.    NSString* phoneVersion = [[UIDevice currentDevice] systemVersion];  

  12.    NSLog(@"手機系統版本: %@", phoneVersion);  

  13.    //手機型號  

  14.    NSString* phoneModel = [[UIDevice currentDevice] model];  

  15.    NSLog(@"手機型號: %@",phoneModel );  

  16.    //地方型號  (國際化區域名稱)  

  17.    NSString* localPhoneModel = [[UIDevice currentDevice] localizedModel];  

  18.    NSLog(@"國際化區域名稱: %@",localPhoneModel );  


  19.    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];  

  20.    // 當前應用名稱  

  21.    NSString *appCurName = [infoDictionary objectForKey:@"CFBundleDisplayName"];  

  22.    NSLog(@"當前應用名稱:%@",appCurName);  

  23.    // 當前應用軟件版本  比如:1.0.1  

  24.    NSString *appCurVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"];  

  25.    NSLog(@"當前應用軟件版本:%@",appCurVersion);  

  26.    // 當前應用版本號碼   int類型  

  27.    NSString *appCurVersionNum = [infoDictionary objectForKey:@"CFBundleVersion"];  

  28.    NSLog(@"當前應用版本號碼:%@",appCurVersionNum);  


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章