如何获得完整的iOS设备编程细节(How to get the complete ios devic

2019-10-23 13:52发布

我需要访问有关我的IOS设备通用>设置 - >所有设备的细节,我可以得到除了设备IMEI和序列号调制解调器固件的详细信息,有什么办法,以获得完整的设置我的应用程序或捆绑上面提到的细节

Answer 1:

添加Message.framework到项目,并获取IMEI号码,

NetworkController *ntc = [NetworkController sharedInstance];
NSString *imeistring = [ntc IMEI];

苹果允许一些设备的细节,不给IMEI,序列号。 在UIDevice类提供细节。

class UIDevice : NSObject {

    class func currentDevice() -> UIDevice

    var name: String { get } // e.g. "My iPhone"
    var model: String { get } // e.g. @"iPhone", @"iPod touch"
    var localizedModel: String { get } // localized version of model
    var systemName: String { get } // e.g. @"iOS"
    var systemVersion: String { get } // e.g. @"4.0"
    var orientation: UIDeviceOrientation { get } // return current device orientation.  this will return UIDeviceOrientationUnknown unless device orientation notifications are being generated.

    @availability(iOS, introduced=6.0)
    var identifierForVendor: NSUUID! { get } // a UUID that may be used to uniquely identify the device, same across apps from a single vendor.

    var generatesDeviceOrientationNotifications: Bool { get }
    func beginGeneratingDeviceOrientationNotifications() // nestable
    func endGeneratingDeviceOrientationNotifications()

    @availability(iOS, introduced=3.0)
    var batteryMonitoringEnabled: Bool // default is NO
    @availability(iOS, introduced=3.0)
    var batteryState: UIDeviceBatteryState { get } // UIDeviceBatteryStateUnknown if monitoring disabled
    @availability(iOS, introduced=3.0)
    var batteryLevel: Float { get } // 0 .. 1.0. -1.0 if UIDeviceBatteryStateUnknown

    @availability(iOS, introduced=3.0)
    var proximityMonitoringEnabled: Bool // default is NO
    @availability(iOS, introduced=3.0)
    var proximityState: Bool { get } // always returns NO if no proximity detector

    @availability(iOS, introduced=4.0)
    var multitaskingSupported: Bool { get }

    @availability(iOS, introduced=3.2)
    var userInterfaceIdiom: UIUserInterfaceIdiom { get }

    @availability(iOS, introduced=4.2)
    func playInputClick() // Plays a click only if an enabling input view is on-screen and user has enabled input clicks.
}

例如: [[UIDevice currentDevice] name];



Answer 2:

不幸的是,苹果暴露于获得iOS设备的IMEI或序列号编程没有这样的API。 这是一个苹果的讨论论坛话题这一点。



文章来源: How to get the complete ios device details programatically