-2

I own a wholesale distribution business focusing on iPhones. I am also an apple developer. I want to create a database that stores all device information by simply installing the app. I understand that this would completely be rejected if I were to send it off to the App Store but this is just in house and I will install simply with Apple Configurator.

I have found online that you no longer can get access to UDID and IMEI numbers. Is there a way for me to do this, not worrying about getting into the app store review policies. I just need an NSString for basic information about the device.

  • UDID
  • IMEI
  • Carrier
  • iOS Version
  • Storage Capacity
  • Model

I know how to find iOS Version and Model but cannot find any others.

jscs
  • 63,694
  • 13
  • 151
  • 195
  • I dont think you can get IMEI and carrier. I know UDID can change so it doesn't mean much anymore..it used to be a solid number but now it can change – TooManyEduardos Mar 08 '16 at 02:11

1 Answers1

0

You can no longer get UDID or IMEI.

To get the other data:

#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 ];
wottle
  • 13,095
  • 4
  • 27
  • 68