I'm wondering is it possible to receive information about battery like: capacity (mA), voltage (V), cycle count within iOS?
I know UIDevice class, but battery level is not what I'm looking for.
I'm wondering is it possible to receive information about battery like: capacity (mA), voltage (V), cycle count within iOS?
I know UIDevice class, but battery level is not what I'm looking for.
Look at the JSystemInfoKit library.
You want to import the IOKit framework first (get the .framework file from here /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/IOKit.framework ) and IOKit headers (get those files from here) in your iOS project.
Here you can find the methods you need to use to get extensive battery information.
Plus, IOPSCopyPowerSourcesInfo (from IOPowerSources.h) returns a NSDictionary with more information like battery health.
I might be wrong about this but using public APIs this is not possible. According to the
UIDevice
documentation, it appears the most you can do is get the battery charge level, its state, and enable battery monitoring.Update 15th Feb 2019: Looks like iOS
UIDevice
API's now allow developers to get access to battery charge level for the device. Whooo! It currently exposes 4 different API's. By the looks of it these are not "private", in other words can be used safely by developers without Apple blocking your app from AppStore.Getting the Device Battery State
var batteryLevel: Float
(The battery charge level for the device).var isBatteryMonitoringEnabled: Bool
(A Boolean value indicating whether battery monitoring is enabled (true) or not (false)).var batteryState: UIDevice.BatteryState
(The battery state for the device).enum UIDevice.BatteryState
(The battery power state of the device).Try UIDeviceListener, it basically steals the entire battery data dictionary from
UIDevice
without using any private APIs. It exposes tons of information:Yes it is possible..by using private framework iosDiagnosticsupport.Framework.
After doing some tests, i have certain data about battery rather overall logs for iDevice. Here are some links that might help you... iOS Diagnostics Part 3
Its possible to fetch Battery capacity and voltage using public API and which allowed in app store as well. Here is the link -