Our app uses a 24-hour DeviceActivityMonitor repeating schedule to send users notifications for every hour of screen time they spend on their phone per day. Notifications are sent from eventDidReachThreshold callbacks at 1, 2, 3, etc, hour thresholds to keep them aware of their screen time.
We have recently received an influx of emails from our users that after updating to iOS 17.6.1 their DeviceActivityMonitor notifications are saying their screen time was much higher than what is shown in DeviceActivityReport and their device's Screen Time settings.
These users have disabled "Share Across Devices" - but I suspect the DeviceActivityMonitor is still getting screen time from their other devices even though that setting is turned off.
Has anybody else noticed this, understands what is causing this, or could recommend a fix that we can tell our users to do?
Screen Time
RSS for tagShare and manage web-usage data, and observe changes made to Screen Time settings by a parent or guardian.
Posts under Screen Time tag
123 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi, it seems that with iOS26 the system displays two entries in the screentime report for apps that use a WKWebView: one for the app itself and one for the website that was displayed in the app. We don't see this behaviour in iOS18.7.
I'm reseaching how to disable the recording for the webviews in one of our apps (written in Swift with UIKit).
The STWebpageController looked promising, especially the field suppressUsageRecording, but the whole class is poorly documented.
We initialized it with the bundle identifier of the app and set the url of the wkwebview as the url in STWebpageController. It looks a bit like this:
webView = WKWebView(frame: .zero, configuration: config)
view.addSubview(webView)
//setup STWebpageController
webpageController = STWebpageController()
do {
try webpageController!.setBundleIdentifier(bundleIdentifier)
} catch{
}
webpageController!.suppressUsageRecording = true
addChild(webpageController!)
view.addSubview(webpageController!.view)
webpageController!.view.frame = view.frame
webpageController!.didMove(toParent: self)
//load url in webView
let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData)
webview.load(request)
webpageController?.url = request.url
This has no effect on the recorded screentime for the webview inside our app - we still see the same time for the container app and the included webview.
Any suggestions?
Thanks,
Heiko
I am building a screen time management app. It has the main app target, and then three extensions - those are the four targets in Xcode. The three extensions are:
Shield
Device Activity Monitor
Device Activity Report Extension
I requested "Family Controls (Distribution)" capability from Apple for the main app target / bundle ID, and it got approved.
Do I need it for the extensions too? Because previously I had "Family Controls (Development)" for the extensions...
Hello,
I think it is quite a common use-case to open the parent app that owns the ShieldActionDelegate when the user selects an action in the Shield.
There are only three options available that we can do in response to an action:
ShieldActionResponse.none
ShieldActionResponse.close
ShieldActionResponse.defer
It would be great if this new one would be added as well:
ShieldActionResponse.openParentApp
While finding a workaround for now, the problem is that the ShieldActionDelegate is not a normal app extension. That means, normal tricks do not work to open the parent app from here.
For example, UIApplication.shared.open(url) does not work because we can’t access UIApplication from the ShieldActionDelegate unfortunately.
NSExtensionContext is also not available in the ShieldActionDelegate unfortunately, so that’s also not possible.
There are apps however, that managed to find a workaround, in my research I stumbled across these two:
https://apps.apple.com/de/app/applocker-passcode-lock-apps/id1132845904?l=en-GB
https://apps.apple.com/us/app/app-lock/id6448239603
Please find a screen recording (gif) attached.
Their workaround is 100% what I’m looking for, so there MUST be a way to do so that is compliant with the App Store guidelines (after all, the apps are available on the App Store!).
I had documented my feature request more than 2 years ago in this radar as well: FB10393561
class ShieldActionExtension: ShieldActionDelegate {
override func handle(action: ShieldAction, for application: ApplicationToken, completionHandler: @escaping (ShieldActionResponse) -> Void) {
// Handle the action as needed.
switch action {
case .primaryButtonPressed:
if let url = URL(string: "blockfocusapp://") {
let extensionContext = NSExtensionContext()
extensionContext.open(url, completionHandler: nil)
}
//
completionHandler(.defer)
case .secondaryButtonPressed:
let userDefaults = UserDefaults(suiteName: "group.in.appsquare.FocusApp.shieldExt")
userDefaults?.set(false, forKey: "shouldOpenMainApp")
completionHandler(.defer)
@unknown default:
fatalError()
}
}
override func handle(action: ShieldAction, for webDomain: WebDomainToken, completionHandler: @escaping (ShieldActionResponse) -> Void) {
// Handle the action as needed.
completionHandler(.close)
}
override func handle(action: ShieldAction, for category: ActivityCategoryToken, completionHandler: @escaping (ShieldActionResponse) -> Void) {
// Handle the action as needed.
completionHandler(.close)
}
}
I want to be able to open my app from ShieldActionExtension
I’m using the shielding API, my code:
let store = ManagedSettingsStore()
let whitelist = SharedDefaults.whitelistApplications
store.shield.applicationCategories = .all(except: whitelist)
And to clear the shield, my code is:
store.shield.applications = nil
store.shield.applicationCategories = nil
The issue:
Some users report that after uninstalling my app, the shield is still active, and the UI changes to the default iOS system interface. Even after restarting the device, the apps on the phone remains locked, so the user has no way to remove the shield.
Recently I’ve received several complaints on social media and App Store comments, accusing my app of being malicious software.
This is not a 100% reproducible bug, but it happens frequently enough. I was also able to reproduce it myself by uninstalling the app during an active lock session.
Could Apple engineers please look into this issue and advise how to ensure that once the user uninstalls the app, the device is no longer locked?
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
Please!
is there an app or anything I can do
ive posted multiple times.
Ive researched all that I can
even with screen time on and web limits it still lets u swipe to delete history! Yes it’s grayed out but u can still swipe and delete it!!
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
Hello everyone,
I would like to know if there is any way for an iOS app to automatically access a user’s total Screen Time (for example, daily or weekly usage) and then share this with friends so they can compare results, like in a “Screen Time battle”?
Thanks you very much for you help!
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
We are developing a parental control application in SwiftUI with features like app blocking and screen time management. We are using the Family Control API along with Apple Family Sharing, allowing parents to add multiple children to the family group. We have followed the apple documentation still we are facing following issues:
App Blocking Issue: The family picker does not display each child's name separately or their apps individually. Instead, it shows all children's apps together, making it difficult to block apps for a specific child.
Screen Time Data Issue: We receive the total screen time usage for all children combined rather than separate screen time data for each child.
Syncing Delay: When a new child is added to the Family Sharing group, we are unsure how long it takes for their apps to sync and appear on the parent’s device.
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
I’m trying to integrate Screen Time usage data into my iOS app.
The goal is to fetch the total time a user spends on their device (daily or weekly), and store this locally for analysis.
So far, I’ve explored the DeviceActivity and FamilyControls frameworks:
1.DeviceActivityReport works but seems tied to extensions that show reports, not directly fetching raw values inside the main app.
2.I haven’t found a way to simply retrieve the total screen-on time (similar to what Settings → Screen Time shows).
My questions:
1.Is there any public API that allows retrieving the user’s total Screen Time (like the one shown in Settings)?
If yes, what’s the correct approach — should I use 2.DeviceActivityMonitorExtension, FamilyActivitySelection, or another framework?
3.If not, is it expected that this data is only available in the Settings app and not exposed to developers?
Any guidance or official confirmation would be really helpful.
Thanks in advance!
Our users report frequent crashes with the FamilyActivityPicker. Since this is a screen controlled by Apple, I'm assuming that there's nothing I can do to prevent these crashes.
I'm wondering, though, if there's any way to gracefully handle these crashes? When this happens, the following is printed to the console:
[com.apple.FamilyControls.ActivityPickerExtension(1121)] Connection to plugin invalidated while in use.
Does anyone know how to handle/catch this error?
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’m presenting the familyActivityPicker from a presented sheet in my application.
When I select some apps, categories or websites and tap “Done”, the familyActivityPicker is dismissed but the presenting sheet is also dismissed on iOS 18.4, iOS 18.5, iOS 26 beta 1 and 2. If I tap on “Cancel” from the familyActivityPicker, the sheet is also dismissed on iOS 18.4, iOS 18.5, iOS 26 beta 1 and 2.
The same code works perfectly fine on iOS 18.0, iOS 18.1, iOS 18.2 and iOS 18.3.
Is this a known-issue?
If opened the feedback FB18369821 for this.
Regards,
Axel
Topic:
App & System Services
SubTopic:
General
Tags:
SwiftUI
Family Controls
Managed Settings
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()
}