New user requests help regarding using IOS battery usage data in an iPhone app

Hi, I am a non programmer (a lawyer, if fact, with an interest in coding) gand I have an idea for an app. I've downloaded Xcode and started following some lectures about coding in Swift and find it intersting albeit quite intimidating.

IOS gives you percentage battery use as well as time spent on each app on your phone in Settings. I want to use that data to make an app that when you open it, it will show 6 or 8 or however many relevant dials or progress bars or something, showing how much time youve spent on your phone in the past 24 hours / 7 days. For example, on top will be Whatsapp : 4:30, Facebook: 2:23; Safari: 1:21 etc.

Is this even possible? And if so how do I get to this data? I will most likely get a developer to write the app for me in the end - Seems unlikely that I would be able to teach myself Swift in a reasonable time to do this but it would be interesting to see how to do it anyway.

Thanks

Andre

As far as I'm aware this data isn't available outside of the settings app. Someone correct me if I'm wrong.

As @dlbuckley has mentioned, AFAIK there is no public API to retrieve this information. Sorry!

As a side note, such questions are generally out of the realm of the Swift Forums, which deal with the language itself rather than Apple's APIs. A better place to ask questions like these is probably something like Stack Overflow or Apple's Developer Forums.

4 Likes

Thank you both, for your helpful replies.

A.