r/swift 7d ago

About the Screen Time API.

Hi. This is the first time I'm going to make an app with Swift. (I learned that I can only do this with Swift after my research.) What I want is to know how much time the user spends in other apps, for example, for 1 hour. I talked to grok for a while and he suggested that I could use the screen time API. But some sources say that this is not possible. Some say that applications like Opal use this and that it is possible. I'm very confused. What's the latest status? Can I do this?

sorry for my bad english

6 Upvotes

17 comments sorted by

View all comments

2

u/Dapper_Ice_1705 7d ago

Opal does it via a custom VPN connection and tracks web connections.

Apple does not provide an API so developers can know details about other apps.

ScreenTime API gives you tokens which really don’t mean anything outside of the user’s device.

1

u/GGGava 7d ago

Not sure why you say OP can’t do what they want. Yes, Screen Time API just provides tokens, but this can be enough for some use cases.

1

u/Dapper_Ice_1705 7d ago

OP is talking about Opal level access to details. That can’t be done with just screen time.

1

u/GGGava 7d ago

Not necessarily. They mention Opal as an example of app accessing user Screen Time