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.
View your Screen Time report After you turn on Screen Time, you can view a report of your device use with information including how much time you spend using certain kinds of apps, how often you pick up your iPhone and other devices, what apps send you the most notifications, and more. Go to Settings > Screen Time.
The usage time of an app will not be calculated when it is running in the background or after it is stopped.
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.
Since apple have added screen time app into ios12 simulator. There could be a chance they provide the API's soon.
On iOS 15 Apple has added an API, see here: https://developer.apple.com/documentation/FamilyControls
FamilyControls
Authorize your app to provide parental controls on a child’s device. To authorize your parental controls app, use a shared AuthorizationCenter instance. You can authorize parental controls only on a device that is part of a Family Sharing group and signed into a child’s iCloud account.
You must add the Family Controls capability to your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With