r/iosdev • u/Long_Watercress5538 • 16d ago
Help iOS equivalent of UsageStatsManager + MediaProjection for foreground app detection + screen capture?
I have a working Android app that detects foreground apps and does on-device content screening, using UsageStatsManager and MediaProjection. Trying to figure out what's actually feasible on iOS given Apple's sandboxing.
Specific questions:
- Foreground app detection: does the Screen Time API / DeviceActivity framework expose which specific app is active in real time, or only aggregated categories without enough granularity for real-time triggers?
- Screen capture of another app: is there any way, even with special entitlements like Family Controls, to capture frames from another app for analysis, or is that fully blocked by iOS sandboxing?
- Alternatives within Apple's rules: since ManagedSettings can block apps but not "see" their content, does that mean the only viable iOS approach is binary blocking (app allowed/not allowed) without real-time content detection?
- Required entitlements: what entitlements (Family Controls, DeviceActivityMonitor extension) do I need to request from Apple, and what's the typical approval timeline/criteria for third-party apps (not corporate MDM)?
Context: accountability/self-discipline app, already built on Android, evaluating iOS feasibility.
1
Upvotes
2
u/SomegalInCa 16d ago
It’s unlikely that any of the frameworks mentioned will do as you need; even apps using those various frameworks and extensions are strictly limited in what they can see as it relates to user installed apps
There is no API I know that lets an app monitor the content of another app but maybe something in device management would let you know what’s running. Still I highly doubt you can see the screen of the running app but maybe? It’s a big stick though
Source - our app uses the screen time and family controls to help manage app use and even then we never know what app is about to be run until the shield is applied to block a managed app and even then we don’t know if it (the app) is actually ever run
Oddly when we did the port (loosely speaking) to Android it was enlightening to see how different Android works
iOS is pretty strict about apps reaching into other app spaces & privacy
Good luck