2016-03-08 49 views
-2

我拥有专注于iPhone的批发分销业务。我也是一名苹果开发者。我想通过简单地安装应用程序来创建一个存储所有设备信息的数据库。我明白,如果我将它发送到App Store,这将完全被拒绝,但这只是内部的,我将仅使用Apple Configurator进行安装。获取iPhone数据

我在网上发现,您不再可以访问UDID和IMEI号码。有没有办法让我这样做,而不必担心进入应用商店审查政策。我只需要一个NSString来获取关于设备的基本信息。

  • UDID
  • IMEI
  • 载波
  • IOS版本
  • 存储容量
  • 型号

我知道如何找到IOS版本和型号,但无法找到任何其他人。

+0

我不认为你可以得到IMEI和载体。我知道UDID可以改变,所以它不再意味着什么..它曾经是一个固定的数字,但现在它可以改变 – TooManyEduardos

回答

0

您无法再获取UDID或IMEI。

要获取其他数据:

#import <CoreTelephony/CTTelephonyNetworkInfo.h> 

// carrier info 
CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init]; 
CTCarrier *carrier = [netinfo subscriberCellularProvider]; 
NSLog(@"Carrier Name: %@", [carrier carrierName]); 

// Misc device info 
UIDevice *myDevice = [UIDevice currentDevice]; 
NSString *deviceName = myDevice.Name; 
NSString *deviceSystemName = myDevice.systemName; 
NSString *deviceOSVersion = myDevice.systemVersion; 
NSString *deviceModel = myDevice.model; 

// Get the capacity of the device. 
NSError *error = nil; 
NSArray * const paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
NSDictionary * const pathAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths firstObject] error:&error]; 
NSAssert(pathAttributes, @""); 
NSNumber * const fileSystemSizeInBytes = [pathAttributes objectForKey: NSFileSystemFreeSize]; 
const long long numberOfBytesRemaining = [fileSystemSizeInBytes longLongValue]; 
NSByteCountFormatter *byteCountFormatter = [[NSByteCountFormatter alloc] init]; 
NSString *formattedNmberOfBytesRemaining = [byteCountFormatter stringFromByteCount:numberOfBytesRemaining]; 
NSString *formattedNmberOfBytesTotal = [byteCountFormatter stringFromByteCount:fileSystemSizeInBytes ];