iosiphone-xxcode10ios12

Programmatically get application usage from Screen Time in iOS 12


I am working on one project and I want to get other application usage time. apple has launched iOS 12 and provides the new feature Screen Time. I want to know is there any way or API provided by Apple to get data from it.


Solution

  • No, on iOS each app runs in its own sandbox and cannot see data from other apps, even apps from the same publisher. An app can access special shared data, like photos from the album or contact data, but it is not possible for an app to directly access files written by other apps.

    ScreenTime application is on another sandbox than your app. Unless apple provide API we can't access the same.


    Update

    Since apple have added screen time app into ios12 simulator. There could be a chance they provide the API's soon.