Reputation: 635
I'm implementing iOS application in which I want to check battery information, like battery status, current battery level, is charging plugged in or not, etc. I did all this, but I want more info about battery like battery temperature, battery health, battery scale, battery technology. All this information is available in android, but can anyone help me to have all these info in iOS?
Upvotes: 6
Views: 2502
Reputation: 596
Try this
[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];
float batteryLevel = [[UIDevice currentDevice] batteryLevel];
//This will give you the battery between 0.0 (empty) and 1.0 (100% charged)
//If you want it as a percentage, you can do this:
batteryLevel *= 100;
Upvotes: 4