问题
I used to use an app called Battery Life on iOS which I believe was using https://github.com/eldade/UIDeviceListener as a method to retrieve the charger's information (as in the wattage amount, voltage, and amplitude). However, that app has since been pulled from App Store and was replaced with a new version without that functionality, and UIDeviceListener has a note saying that it's no longer working in iOS 10+.
Now, I currently have an iPhone X that I charge with Qi charger, and I'm just curious about how much wattage does my Qi charger supplies to my iPhone. I know that for a USB charging I could easily put a USB wattage meter and I could get the number that I want, but because this is an induction charger I feel like I have to test it on the device itself.
Has anybody found a API that would provide this information similar to what UIDeviceListener was reporting (IOKit?)? I'm planning to just side load it to my phone, so using private API wouldn't be an issue.
Thank you.
回答1:
It seems you can do it with the private API IOKit as you suggested.
I found this project : https://github.com/ethan605/ios-battery-stat
It's old, so it might need some modifications
Edit : I found this one, much more recent : https://github.com/eldade/EEIOKitListener
来源:https://stackoverflow.com/questions/47457127/is-there-a-way-to-get-iphone-chargers-information-in-ios-10-using-private-api