How to get battery information in iOS - Stack Overflow
过去多啦不再A梦
过去多啦不再A梦 2017-05-02 09:23:19
0
2
863

Want to get battery-related information, such as: battery voltage, current, actual battery capacity, battery temperature...

1 Is there any way to publicly obtain this information?

I tried to use IOKit to obtain this data, but these are private APIs and may be rejected for review. Among the public APIs, Apple does not provide this interface (or I can’t find it. If you know it, please let me know. grateful).

2 If I can only use private APIs, is there any way to bypass Apple's detection of private APIs?

Can code obfuscation or other encryption methods be used in iOS to bypass review? There is really too little contact in this area. So let me ask you some advice.

过去多啦不再A梦
过去多啦不再A梦

reply all(2)
漂亮男人

There are quite few official battery-related APIs. Here are all the results.
You can only get the power and battery charging status.
The functions you need can only be implemented by private APIs.
UIDeviceBatteryStateDidChangeNotification
In short, That is not possible in the public API.
It can only be implemented using the private API in IOKit.framework
Here is the implementation of IOKit.framework

给我你的怀抱

Hello, can you add QQ to communicate 1359098941

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template