Retrieve information in Notice ‘batteryStatus’

Guys,

Looking for some API to retrieve information of batt. But I have the condition to work under iOS 10.

So, I found something very interesting!

Looking the console of device, I found this:

Jun 20 11:01:50 Billys-iPhone locationd[57] : {“msg”:”battery capacity info”, “batteryStatus”:”{“level”:98.000000, “charged”:false, “connected”:true, “chargerType”:”kChargerTypeUsb”, “wasConnected”:false”, “”:””, “currentCapacity”:”1470″, “maximumCapacity”:”1500″, “batteryIsDifferent”:”0″}

Jun 20 11:01:50 Billys-iPhone coreduetd[2650] : CDDBatteryMonitor: received batterycallback, currentPercentage:98.000000!

 

The question is: How can I retrive on Swift this information?

I need the currentCapacity and maximumCapacity.

 

Thank you!

Powered by WPeMatico

You may also like...

Comments are closed.