How to get real time battery level on iOS with a 1% granularity

后端 未结 7 1698
清酒与你
清酒与你 2020-12-05 03:19

I\'m using this function to get current battery level of device:

[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];
UIDevice *myDevice = [UIDevice c         


        
相关标签:
7条回答
  • 2020-12-05 04:11

    check out this site : Reading the battery level programmatically

    but, carefully use. all of the APIs used here are undocumented on the iPhone, and will probably lead to a rejection if you submit this application to the App Store. Although battery charge status is not exactly, I'd recommend using the UIDevice battery monitoring methods.

    0 讨论(0)
提交回复
热议问题