在iOS上获取电池健康信息 [英] Getting Battery Health Information on iOS

查看:528
本文介绍了在iOS上获取电池健康信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前app-store中的应用程序(因此不需要越狱)告诉您:


  1. 确切您在iPhone上的电池电量百分比值。我
    已经尝试了Apple的官方






    当[UIDevice]这些应用程序如何获得有关电池运行状况的详细信息时]提供的信息很少,几乎没有关于电池健康状况和性能的信息。

    解决方案

    很可能这样的应用程序使用IOKit框架,它在OS X上是公开的,但在iOS上是私有的(Apple不允许使用私有框架用于App Store应用程序,尽管有时在审查期间可能会被忽略)。



    您可以在此处查看示例项目。


    There are currently apps in the app-store (so it does not require jailbreak) that tell you :

    1. Exact percentage value of battery level you have on your iPhone. I have tried Apple's official Code Sample, although it tells you when your iPhone is charging and discharging but it gives me values in 5% steps. How do these apps get exact values of battery percentage?

    2. Applications like Battery Health show

      • Current Maximum Capacity vs Manufacturer's Capacity
      • Current Discharge Rate
      • Lifetime Battery Cycle Count
    3. The same application also gives information about the Charging Rate in Watts when the phone is charging (check images) and current Charger's Power Rating.


    How do these applications get so much detail about battery health when [UIDevice] provides so little information about it and almost no information on battery health and performance.

    解决方案

    It is likely that such apps use IOKit framework, which is public on OS X but private on iOS (it's not allowed by Apple to use private frameworks for App Store apps, although sometimes it can be overlooked during the review).

    You can see a sample project here.

    这篇关于在iOS上获取电池健康信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆