How to get the complete ios device details programatically

a 夏天 提交于 2020-01-06 02:24:46

问题


I need to access all the device details in general->settings->about in my IOS device , i can get the details except device IMEI and serial number modem firmware, there is any way to get the complete settings bundle in my application or the above mentioned details


回答1:


Adding Message.framework to your project and Get IMEI Number,

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

Apple allow some of the details of device, Not give IMEI, serial Number. in UIDevice class provide details.

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.
}

example : [[UIDevice currentDevice] name];




回答2:


Unfortunately, there is no such API exposed by Apple to get IMEI or serial number of an iOS device programmatically. Here is a Apple Discussion Forum Thread on this.



来源:https://stackoverflow.com/questions/31135421/how-to-get-the-complete-ios-device-details-programatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!