See https://developer.apple.com/documentation/uikit/uidevice/1620042-batterylevel - as noted there "Before accessing this property, ensure that battery monitoring is enabled."
Don't expect 'a lot of data'/fine grain info.
Hello, thank you for your answer, i have already find this documentation, but it's not accurate (not between 0.0 and 1.0, not wround), to explain my problem, I need to get the energy consumed by my application when it's start. Not with instruments, I want to have this metrics on my code to store the data on database and to have a followed on the timestamp.
I need to get the energy consumed by my application when it's start. Not with instruments …
There’s no API for that. If you’d like to see one added, you should describe your requirements in an enhancement request.
Please post your bug number, just for the record.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"