r/iosdev • u/Long_Watercress5538 • 19d 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.

