Pretty much as per the title and I suspect I know the answer. Given that Foundation Models run on device, is it possible to use Foundation Models framework inside of a DeviceActivityReport? I've been tinkering with it, and all I get is errors and "Sandbox restrictions". Am I missing something? Seems like a missed trick to utilise on device AI/ML with other frameworks.
Device Activity
RSS for tagMonitor web and app usage through custom time windows and events.
Posts under Device Activity tag
84 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello!
I am experiencing some strange bugs around DeviceActivityEvents:
When creating a DeviceActivityEvent we can assign a threshold and applicationTokens.
The idea is, that after the user has spent said threshold on said apps, eventDidReachThreshold is called.
includesPastActivity is set to false.
On iOS 26 however, it happens (quite reliably after updating to a new beta seed) quite often that eventDidReachThreshold is called immediately (after a couple of seconds) instead of waiting for the threshold to be met.
Is anyone else seeing similar issues on iOS 26?
Only workaround I have found is to ask users to re-grant Screen Time permissions. This only holds for about two weeks though or at most until the next iOS 26 beta update is installed.
Feedback filed under:
FB18061981
FB18927456
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Managed Settings
Screen Time
I am still struggling to nail down the screen time between monitoring and showing it in a DeviceActivityReport. It's always off by a couple of percentage points, which results in a difference of a couple of minutes between the time shown for my total screen time in DeviceActivityReport and DeviceActivityMonitor with a threshold set for all apps/websites/categories.
In the report, I am looping through all segment (there is only 1 segement using .daily segment interval for a given day) then loop through all categories and all apps within each category and sum up all totalActivityDuration for each app. Based on avaiable documentation, that should corrolate to DeviceActivityMonitor threshold but it doesn't. Are there any differences in how these 2 places count screen time? Are there any apps/core ios services which are excluded from DeviceActivityMonitor. Would appreciate any help at all, I'm losing my mind here.
My current suspicion is that Apple Developer documentation is counted twice. i.e. this website https://developer.apple.com/documentation/deviceactivity/deviceactivitymonitor shows up in usage as an App with bundleId of apple.developer.wwdc-release and time spent there is counted twice, against this bundleId AND Safari. I don't know why it's not counted as a webdomain.
Hello everyone,
I’ve been stuck for weeks on an issue with Family Controls + Device Activity entitlements in my iOS app, and Apple Developer Support has not provided a solution so far. I’m hoping someone here who has successfully implemented Family Controls + Device Activity can point me in the right direction.
About the App
• The app is a Digital Wellbeing app called Breakloop.
• It lets users select apps they want to block, requires them to complete a positive affirmation before opening those apps, and can re-block apps after a set time (e.g., 10 minutes).
• This functionality exactly matches the purpose of Family Controls and Device Activity APIs.
What Works So Far
• Family Controls capability is enabled in the main app target in Xcode.
• We have valid Apple Developer certificates (Apple Development) and a team account.
• The main app builds and runs fine when using Family Controls alone.
• We have App IDs for:
• bl.Breakloop (main app)
• bl.Breakloop.BreakloopMonitorExtension
• bl.Breakloop.BreakloopShieldConfigurationExtension
The Problem
The provisioning profiles for the extension targets (BreakloopMonitorExtension and BreakloopShieldConfigurationExtension) do not include the com.apple.developer.device-activity entitlement even though:
• The App IDs in the Developer Portal have Family Controls (Development) enabled.
• The extensions have the correct entitlements file with both:
com.apple.developer.family-controls
com.apple.developer.device-activity
• Xcode Signing & Capabilities points to the correct provisioning profile + certificate.
Because the provisioning profiles don’t include the entitlement, the build fails with:
Provisioning profile doesn't include the com.apple.developer.device-activity entitlement.
What Apple Support Said
Apple Support told me:
• “Family Controls grants access to Device Activity.”
• They cannot enable it manually or guarantee that profiles will include the entitlement.
• They sent links to the documentation but no further assistance.
What I Need Help With
1. Has anyone successfully built extensions using Family Controls + Device Activity?
2. Do I need to request any additional approval for Device Activity, or should it appear automatically once Family Controls is enabled?
3. Is there a known Xcode or Apple Developer Portal configuration issue that causes the entitlement to be missing in provisioning profiles?
4. Any working example of a project setup that uses Family Controls + Device Activity in extensions would be extremely helpful.
Extra Info
• We use the latest Xcode + iOS SDK.
• Tried recreating certificates, profiles, and App IDs multiple times.
• Followed Apple’s docs for Family Controls + Device Activity exactly.
I would greatly appreciate any guidance, especially from someone who has this working with iOS app extensions.
Thank you!
Topic:
Code Signing
SubTopic:
Entitlements
Tags:
Entitlements
Family Controls
Device Activity
Screen Time
Hi, after updating to iOS 26 I'm encountering an issue where the FamilyActivityPicker no longer opens. No errors are shown in the console, it just never shows up. It works fine pre iOS 26. I've never had any issues with the picker showing up until iOS 26. My latest update was rejected because of this issue, but I've changed nothing in the code. Is anyone else experiencing this?
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Managed Settings
Hello! I am working on a screentime app and wondering if anyone has had success achieving reliable background shield application while using com.apple.ManagedSettingsUI.shield-configuration-service?
I recently switched from com.apple.deviceactivity.shield-configuration (which worked reliably but isn't accepted by TestFlight) and have not found any consistency getting shields to apply while the app is backgrounded.
I believe this is a known limitation of ManagedSettingsUI and want to know if there are successful workarounds or any specific patterns/timing that improve consistency?
Topic:
App & System Services
SubTopic:
General
Tags:
Extensions
Device Activity
Managed Settings
Screen Time
I started monitoring using the following code:
deviceActivityCenter.startMonitoring(
DeviceActivityName(name),
during: makeDailySchedule(),
events: events
)
Where:
DeviceActivitySchedule(
intervalStart: DateComponents(hour: 0, minute: 0),
intervalEnd: DateComponents(hour: 23, minute: 59),
repeats: true,
warningTime: nil
)
In DeviceActivityMonitor, I read and write data using UserDefaults and keep the logic minimal to ensure the size does not exceed 6MB.
However, after a period of time, monitoring continues to fail.
Why is this happening? How can I resolve this issue?
I'm working on an app for iOS that will help people get tasks done.
Within the app, we use a ManagedSettingsStore to let the user setup distracting apps. When the user opens any of those apps while it is being shielded, our ShieldConfiguration target opens and displays a screen that we configure with the description of the task they are supposed to do. On the bottom of the view, there are two buttons, one to start the task, and another to dismiss and return to their home screen.
I want to have the button that starts the task open up the main application and deeplink to the focus view with the task that they started. Currently, the only thing that we can tell the system to do is via a ShieldActionResponse which is an enum with 3 cases: none, close, or defer.
None of these three allow us to open the main application. I have found no workarounds that allow us to do it either. I've tried creating a custom URL scheme and calling UIApplication.shared.open(url), but there is no shared application available within the action extension. I have tried using a NSExtensionContext to open a url, but that does not work either. I have even tried starting a live activity to show the user what task they are working on and have a live timer, but that does not work either.
I know it is technically possible, because an app I downloaded does it perfectly. The app is called "Ascent: Screen Time Control". Is there some sort of extension I am missing, or entitlement I have not requested? Any help would be very appreciated.
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Managed Settings
Screen Time
Hello,
I have noticed that the ShieldConfiguration is only requested when opening a target app, and never when the application token is moved to a different shield while the target app remains in foreground.
This causes problems because many times the wrong ShieldConfiguration is displayed (recycled) instead of requesting a new ShieldConfiguration.
This bug has been around since the introduction of the Screen Time API in 2020 and is has not been addressed.
Bug reports:
FB14237883
FB17902392
Please fix asap!! Not acceptable to have bugs not being addressed for more than 5 years.
Most concerning: This is still reproducing on iOS 26 beta 7!!
Thanks a lot for your help.
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Managed Settings
Screen Time
As discussed and acknowledged here, there is a known bug with the FamilyActivityPicker. When a user expands a category that contains enough tokens to exceed the 50mb memory limit, the FamilyActivityPicker crashes.
This happens quite frequently for heavy Safari users. An apple engineer mentioned on this thread that WebDomains shown in the picker are present based on the last 30 days of usage data as surfaced by WebKit.
Is there any way a user can clear these WebDomains? Either programatically through our app or any other process we can guide them to as a workaround while this issue is getting fixed?
Topic:
App & System Services
SubTopic:
General
Tags:
WebKit
Family Controls
Device Activity
Screen Time
Hello, I am trying to display basic screen time data on my main screen. On the initial load of the screen, the DeviceActivityReport renders correctly and visible, but after being in the background and coming back to the app, the whole view is just blank. I don't think I'm doing anything special. Is this a known bug?
@main
struct MyActivityReportExtension: DeviceActivityReportExtension {
var body: some DeviceActivityReportScene {
// Create a report for each DeviceActivityReport.Context that your app supports.
TotalActivityReport { totalActivity in
TotalActivityView(totalActivity: totalActivity)
}
// Add more reports here...
}
}
extension DeviceActivityReport.Context {
// If your app initializes a DeviceActivityReport with this context, then the system will use
// your extension's corresponding DeviceActivityReportScene to render the contents of the
// report.
static let totalActivity = Self("Total Activity")
}
struct TotalActivityReport: DeviceActivityReportScene {
// Define which context your scene will represent.
let context: DeviceActivityReport.Context = .totalActivity
// Define the custom configuration and the resulting view for this report.
let content: (String) -> TotalActivityView
func makeConfiguration(representing data: DeviceActivityResults<DeviceActivityData>) async -> String {
// Reformat the data into a configuration that can be used to create
// the report's view.
let formatter = DateComponentsFormatter()
formatter.allowedUnits = [.day, .hour, .minute]
formatter.unitsStyle = .abbreviated
formatter.zeroFormattingBehavior = .dropAll
let totalActivityDuration = await data.flatMap { $0.activitySegments }.reduce(0, {
$0 + $1.totalActivityDuration
})
return formatter.string(from: totalActivityDuration) ?? "No activity data"
}
}
struct TotalActivityView: View {
let totalActivity: String
var body: some View {
VStack(alignment: .center, spacing: 4) {
Text("Screen Time")
.font(.system(size: 14, weight: .regular))
.foregroundColor(.secondary)
.frame(maxWidth: .infinity, // stretch to the full cell width
alignment: .center)
Text(totalActivity)
.font(.system(size: 18, weight: .medium))
.foregroundColor(.primary)
}
}
}
And I am using it in my main view:
private var analyticsSection: some View {
HStack(spacing: 24) {
// Some View
DeviceActivityReport(DeviceActivityReport.Context(rawValue: "Total Activity"), filter: DeviceActivityFilter(
segment: .weekly(
during: Calendar.current.dateInterval(
of: .weekOfYear, for: .now
)!
),
users: .all,
devices: .init([.iPhone, .iPad]),
))
.frame(maxWidth: .infinity)
// another view
}
.frame(maxWidth: .infinity, maxHeight: showAnalytics ? 58 : 0)
.padding(.horizontal, showAnalytics ? 24 : 0)
.opacity(showAnalytics ? 1.0 : 0.0)
.clipped()
}
Hello everyone,
I'm hoping to find a solution for a critical issue that is blocking my app's submission to the App Store.
My app uses the Screen Time API and therefore has a main app and a DeviceActivityMonitor extension.
The main app has been successfully granted the Family Controls (Distribution) entitlement. However, the DeviceActivityMonitor extension is stuck with only the Family Controls (Development) entitlement.
This mismatch causes my build to fail during the archive/distribution process with the error:
"Provisioning profile failed qualification. Profile doesn't support Family Controls (Development)."
This is a hard blocker, as the extension is a mandatory part of the API. I have already filled out the entitlement request form and also contacted Developer Support (Case #102666581576), who confirmed they could not assist and directed me here.
My question is:
What is the correct procedure to escalate or resolve the issue of a required extension not receiving the distribution-level Family Controls entitlement after the main app has already been approved?
Has anyone else encountered this specific "Development" vs. "Distribution" mismatch and found a definitive way to resolve it? Any guidance would be greatly appreciated.
Thank you!
Some of our users encounter an issue after updating their iPhone/iPad to iOS 17.5.1.
The tokens passed in the Shield Configuration extension don't match the tokens they selected in my app using the FamilyPicker before updating to iOS 17.5.1. It seems the tokens changed for no reason. My app can't match the token from the ShieldConfigurationDataSource to any tokens stored on my end, causing my shield screens to turn blank. The same applies to tokens in the Device Activity Report extension.
The only workaround I've found is to tell affected users to unselect and reselect apps and websites to block in my app. This gets them new tokens from the FamilyActivityPicker, which solves the issue. However, for some users, the bug reoccurs a few days later. Tokens seem to change again, causing the same issue in the Shield Configuration extension.
I am not able to reproduce the issue on my test devices so I have no sysdiagnose to attach. However, this issue is affecting other screen time apps:
https://developer.apple.com/forums/thread/732845
https://forums.developer.apple.com/forums/thread/756440
FB14082790
FB14111223
A change in iOS 17.5.1 must have triggered this behaviour. Could an Apple engineer give us any updates on this?
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Managed Settings
Hey there! So, I'm trying to see what I'm able to do with the Device Activity Report Extension, and I have a few questions about the following quote:
To protect the user’s privacy, your extension runs in a sandbox. This sandbox prevents your extension from making network requests or moving sensitive content outside the extension’s address space.
In particular, what constitutes the address space for this extension?
Can I save data to a UserDefaults object that only the extension can access? (Apps like Opal allow the user to label apps as "distracting" and "non-distracting", and I'm wondering how they do that!)
From what I've read, I believe it cannot write to a shared app group or model (and I just want to confirm this)
It also seems that there's nothing preventing it from reading data from the main app, so I'm just wondering if it's able to read data from an app group or model with no problem.
Thanks in advance!
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Screen Time
Privacy
Here is a post to gather findings in case anyone found out what this new API does.
Apple did not include any comments or documentation and due to the generic naming we don't know what this API might does.
https://developer.apple.com/documentation/deviceactivity/deviceactivityauthorization?changes=latest_major
Hello,
my app is frequently loosing / forgetting the Screen Time Permission that had been granted previously on iOS 26.
I have experienced it myself, sysdiagnose is in this radar:
FB18997699
But also also my App Store users who have updated to iOS 26 already have reported this bug.
It would be great if Apple could ensure that this bug is addressed before iOS 26 is released to the public.
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Managed Settings
Screen Time
Hello,
I am trying to create a Home Screen widget for iOS that displays device usage statistics — similar to the built-in Screen Time widget Apple provides. The goal is to show the average device usage for a specified period (daily, weekly, or monthly) and optionally include a comparison with the previous period.
I noticed that Apple’s own Screen Time widget presents such information. However, after reviewing the public documentation, I could not find any available API that allows a developer to create a similar experience.
To explore possible alternatives, I implemented a SwiftUI view inside a com.apple.deviceactivityui.report-extension using the Family Controls and Device Activity frameworks. The view works fine within the main app and the report extension context, but when I attempted to use the same view in a WidgetKit extension, I received an error at runtime. This suggests that views from com.apple.deviceactivityui.report-extension are not usable inside widgets, which I understand may be due to sandboxing or limitations of how the extension points are designed.
So far, I’ve found no way to access cumulative or average usage data (screen time, app usage, etc.) from system APIs that can be shown in a widget context. My understanding is that Family Controls and Device Activity frameworks allow observing ongoing activity and building usage reports inside the app, but do not provide access to the same historical or summarized data that Apple’s own widgets display.
Could you please confirm:
Whether there is any supported way to access average device usage (screen time) data for use in a widget?
If not, is this an intentional limitation due to privacy concerns, or is there a roadmap for exposing such APIs in the future?
Are there any APIs or entitlements that could allow similar functionality via WidgetKit?
Thank you for your time and support.
Best regards,
I found that in iOS 18.5, DeviceActivityCenter startMonitoring cannot start multiple monitors, even if their names and periods are different, and restarting the phone cannot solve it. My app uses DeviceActivityCenter, which makes the entire function unusable. (I have less than 20 monitors)
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Managed Settings
Hi everyone,
I’m experimenting with the new ScreenTime DeviceActivityReport view in SwiftUI (iOS 17 / Xcode 15).
My goal is to show the report inside a Button (or, more generally, capture any tap on it) so that I can push a detail screen when the user selects it.
Here’s the minimal code that reproduces the issue:
import FamilyControls
import DeviceActivity
import SwiftUI
struct ScreenTimeView: View {
let center = AuthorizationCenter.shared
@State private var context: DeviceActivityReport.Context =
.init(rawValue: "Total Activity")
@State private var filter = DeviceActivityFilter(
segment: .hourly(
during: Calendar.current.dateInterval(of: .day, for: .now)!
),
users: .all,
devices: .init([.iPhone, .iPad])
)
var body: some View {
ZStack {
DeviceActivityReport(context, filter: filter)
}
.onAppear {
Task {
do {
try await center.requestAuthorization(for: .individual)
} catch {
print("Authorization failed:", error)
}
}
}
}
}
struct ContentView: View {
var body: some View {
ScrollViewReader { _ in
ScrollView(showsIndicators: false) {
VStack {
Button {
print("BUTTON TAPPED") // ← never fires
} label: {
ScreenTimeView()
.frame(height: UIScreen.main.bounds.height * 1.4)
}
}
}
}
}
}
**
What happens**
DeviceActivityReport renders correctly with hourly bars.
Tapping anywhere inside the Button does not trigger print("BUTTON TAPPED").
I’ve tried replacing Button with .onTapGesture, adding .contentShape(Rectangle()), and .allowsHitTesting(true), but nothing registers.
What I’ve checked
Authorisation succeeds—calling code in .onAppear prints no errors.
Removing DeviceActivityReport and replacing it with a plain Rectangle() lets the tap gesture fire, so the issue seems specific to DeviceActivityReport.
Hello! I am a relatively new Apple developer and am almost done with my first app. I am implementing the Screen Time API to my app because the app is designed to help the user digitally detox and I am trying to make it so the user can select which apps they would like to monitor from a list of their apps on their phone so I am using the family activity picker but I just can't extract the data needed to track the apps. I am wondering how to do this. Thank you!
Topic:
App & System Services
SubTopic:
General
Tags:
Frameworks
Family Controls
Device Activity
Screen Time