Screen Time

RSS for tag

Share and manage web-usage data, and observe changes made to Screen Time settings by a parent or guardian.

Screen Time Documentation

Posts under Screen Time tag

149 Posts
Sort by:
Post not yet marked as solved
0 Replies
157 Views
Anyone had any luck modifying any of the Activity pickers with the view modifer. We've tried preferredColorScheme(_:) with no luck. Stuck with black icons half the time - which doesn't match our UI. We've had even less luck modifying the activityPicker sheet view to match our UI. A gigantic 'Choose Activity' sits right in the middle of our activity selection page which already has our own specific headers. Not to mention trying add accessibility option into these views. Anyone had better luck modifiying the activity picker views?
Posted
by shaunmail.
Last updated
.
Post not yet marked as solved
0 Replies
193 Views
Hello, I want to make a simple project that simply displays the user's current daily ScreenTime. I believe you may be able to do the functionality I want with: FamilyControls or ScreenTime. I believe that you may need to pay for the paid developer account in order to access the FamilyControl framework. I am having trouble finding guidance as to how I would do this as most reddit/stackoverflow posts are incomplete with answers and I cannot find demos/code examples/tutorials/sample usage anywhere on google. I would greatly appreciate any help and guidance. If the solution requires the paid developer tier, I am fine with that. Thank you in advance
Posted Last updated
.
Post not yet marked as solved
0 Replies
174 Views
So I woke up today and I saw a screen time limit was placed on my phone. No one in my family placed the screentime limit, and I never placed one when I got my phone. I dont know a screen time passcode because I never made one, because I never set up a screentime limit. I tried restarting and force restarting, didnt work, I have no new updates so that doesnt work either. I dont know what to do. Ive watched like 6 hour video essays on this phone, and its never gave me a screentime limit or warning, so I know its a bug.
Posted
by frisgd1.
Last updated
.
Post not yet marked as solved
0 Replies
241 Views
I have implemented a shielding mechanism via Family Controls to prevent unauthenticated users from deleting specific shortcuts within the Shortcuts app. While this successfully secures the app, it has an unintended consequence: the Shortcuts app no longer appears in Spotlight Search and becomes inaccessible for users subject to this shielding. I understand that this is the default behavior when implementing app shielding or time limits on specific apps. Is there a way to retain the app's visibility in Spotlight Search despite it being shielded?
Posted Last updated
.
Post marked as solved
2 Replies
309 Views
I'm developing an iOS app that uses ScreenTime API. Locally, everything works as expected - I have two physical devices in one Apple Family, and calling AuthorizationCenter.shared.requestAuthorization(for: .child) on a child device shows standard authorization dialog. Currently the app is in a review by Apple, and they are saying they can't authorize as a child. From logs, and a screenshots provided by them, I see that on AuthorizationCenter.shared.requestAuthorization(for: .child) call, FamilyControlsError.restricted error is being thrown. I didn't encounter this error once during development and can't simulate this issue now either. Tried everything - authorization on account that is not a child, not in a family, tried restricting everything possible for a child's device from ScreenTime settings. This specific error is never triggered. Does anyone have idea why this error could happen? My last guess is the review team is using an enterprise account and that somehow intercepts with ScreenTime settings. But I don't have an enterprise account to test this theory.
Posted
by maxbk.
Last updated
.
Post not yet marked as solved
1 Replies
451 Views
Is there a way for me to programmatically check whether a user has disabled my app's access to Screen Time? I currently request Family Controls / Screen Time access upon download by calling the following: AuthorizationCenter.shared.requestAuthorization(for: .individual) I need to be able to detect, though, when a user has gone into Settings -> Screen Time and disabled my app's Screen Time access. I tried calling the following: AuthorizationCenter.shared.authorizationStatus But it appears to have a value of Approved even after I turn off my app's Screen Time access. Is there any way to accurately detect this in the code?
Posted Last updated
.
Post not yet marked as solved
2 Replies
508 Views
Our app uses Family Control and have 2 extensions for monitoring and shielding. We got Family controls Distribution entitlement for main app bundle and we have applied to get for extensions too, but its like 2 months we didn't get the Distribution entitlements for extensions. We need to upload the app to TestFlight, but without Distribution entitlements for extensions we can't do it. Bundle id exp: com.example.example -- Distribution entitlement provided com.example.example.MonitorExtension -- only development entitlement com.example.example.ShieldConfiguratoionExtension -- only development entitlement Is there nay workaround?
Posted Last updated
.
Post not yet marked as solved
2 Replies
484 Views
I am developing a project with the Screen Time API, and I cannot understand why the methods inside DeviceActivityMonitor extension are not being called. Some points to note: I do start by requesting authorization from the User (this is working as expected when opening the app) Both the DeviceActivityMonitor Extension and the main app are under the same App Group I have added Family Controls capability to both targets and have the developer account to use it. I start by calling center.startMonitoring() I have overridden the original methods. Yet, when startMonitoring is called, there is no action that is supposed to be taken that is being taken, and as far as I can tell, the methods aren't even being called. Here are some relevant snippets of code: // EXT class DeviceActivityMonitorExtension: DeviceActivityMonitor { override func intervalDidStart(for activity: DeviceActivityName) { super.intervalDidStart(for: activity) let store = ManagedSettingsStore(named: .daily) } override func intervalDidEnd(for activity: DeviceActivityName) { super.intervalDidEnd(for: activity) let store = ManagedSettingsStore(named: .daily) store.clearAllSettings() } override func eventDidReachThreshold(_ event: DeviceActivityEvent.Name, activity: DeviceActivityName) { super.eventDidReachThreshold(event, activity: activity) let store = ManagedSettingsStore(named: .daily) let model = BeeFreeModel.shared let applications = model.selectionToDiscourage.applicationTokens let categories = model.selectionToDiscourage.categoryTokens let webDomains = model.selectionToDiscourage.webDomainTokens store.shield.applications = applications.isEmpty ? nil : applications store.shield.applicationCategories = categories.isEmpty ? nil : ShieldSettings.ActivityCategoryPolicy.specific(categories) store.shield.webDomains = webDomains.isEmpty ? nil : webDomains } } // APP extension DeviceActivityName { static let daily = Self("daily") } extension DeviceActivityEvent.Name { static let discouraged = Self("discouraged") } let schedule = DeviceActivitySchedule( intervalStart: DateComponents(hour: 0, minute: 0, second: 0), intervalEnd: DateComponents(hour: 23, minute: 59, second: 59), repeats: true ) class BeeFreeSchedule { static public func setSchedule() { print("Setting schedule...") print("Hour is: ", Calendar.current.dateComponents([.hour, .minute], from: Date()).hour!) let events: [DeviceActivityEvent.Name: DeviceActivityEvent] = [ .discouraged: DeviceActivityEvent( applications: BeeFreeModel.shared.selectionToDiscourage.applicationTokens, categories: BeeFreeModel.shared.selectionToDiscourage.categoryTokens, webDomains: BeeFreeModel.shared.selectionToDiscourage.webDomainTokens, threshold: BeeFreeModel.shared.thresholdToDiscourage ) ] let center = DeviceActivityCenter() do { print("Try to start monitoring...") // Call startMonitoring with the activity name, schedule, and events try center.startMonitoring(.daily, during: schedule, events: events) } catch { print("Error monitoring schedule: ", error) } } } // APP class BeeFreeModel: ObservableObject { // Import ManagedSettings to get access to the application shield restriction let store = ManagedSettingsStore() //@EnvironmentObject var store: ManagedSettingsStore @Published var selectionToDiscourage: FamilyActivitySelection @Published var thresholdToDiscourage: DateComponents @Published var setOfApps: [String] init() { selectionToDiscourage = FamilyActivitySelection() thresholdToDiscourage = DateComponents() var setOfAppIdentifiers: Set<String?> = Set<String?>() setOfApps = [String]() if selectionToDiscourage.applicationTokens.isEmpty {} else { for application in BeeFreeModel.shared.selectionToDiscourage.applications { setOfAppIdentifiers.insert(application.localizedDisplayName) setOfApps = setOfAppIdentifiers.compactMap { $0 }.sorted() } } } class var shared: BeeFreeModel { return _BeeFreeModel } func setSelection() { let applications = BeeFreeModel.shared.selectionToDiscourage } func changeThreshold(threshold: DateComponents) { thresholdToDiscourage = threshold } } // APP /// ... Button("Select Apps to Discourage") { isDiscouragedPresented = true } .familyActivityPicker(isPresented: $isDiscouragedPresented, selection: $model.selectionToDiscourage) } .onChange(of: model.selectionToDiscourage) { BeeFreeModel.shared.setSelection() } // ... // ... Button("Save Time") { saveTime() let new_threshold = DateComponents(hour: savedTime?.hours, minute: savedTime?.minutes, second: savedTime?.seconds) model.changeThreshold(threshold: new_threshold) } } .onChange(of: model.thresholdToDiscourage) { BeeFreeSchedule.setSchedule() // ... I believe I am using the latest stable version of Xcode (recently deleted and reinstalled). I'm really new to mobile development to Swift so any help is greatly appreciated. Thank you! :)
Posted Last updated
.
Post not yet marked as solved
1 Replies
245 Views
I am 17, almost 18 years old and still have screen time restrictions on my phone. My downtime every night turns off at midnight, then later turns back on at 7:30 am. Last night I plugged in my phone to go to bed and when I woke up it says that instagram was being used for 4 1/2 hours from 2am to 7am. This is impossible because of my downtime restrictions and now I have no time left on my apps for the day. Does anyone know how to fix this?
Posted Last updated
.
Post not yet marked as solved
4 Replies
550 Views
Over a month ago, I submitted the Family Controls Entitlement form: https://developer.apple.com/contact/request/family-controls-distribution For an app I'm developing and I've received 0 feedback. No case number, no email and I've called and emailed support 3 times but they haven't been able to help me. When can I expect to hear back from the Family Controls team, what's the average wait time.
Posted
by BAStudios.
Last updated
.
Post not yet marked as solved
1 Replies
363 Views
We have integrated DeviceActivityReport to our Family Controll app. All capabilities are added. We built the app and tested it, but when we want to upload to TestFlight the following error happened (see attached image) When we are adding NSExtensionMainStoryboard or NSExtensionPrincipalClass the following error appears during installation process. DeviceReport.appex with id com.example.example.DeviceReport defines either an NSExtensionMainStoryboard or NSExtensionPrincipalClass key, which is not allowed for the extension point com.apple.deviceactivityui.report-extension
Posted Last updated
.
Post not yet marked as solved
1 Replies
507 Views
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?
Posted Last updated
.
Post not yet marked as solved
1 Replies
278 Views
Experiencing a very strange issue with 3rd party permissions not working on screen time as of yesterday on my device (iPhone 12, iOS 17.2.1) and we are concerned that other users may end up dealing with this if it's not resolved. The video attached demonstrates what I mean but this is happening across every single screen time application, not just Opal or ours. I tried resetting my device, hard reboots, deleting and redownloading the apps, updating my phone, and turning screen time off and back on but nothing has worked. I also submitted my feedback (FB13540567)
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.2k Views
Hello, we have rare case of AuthorizationCenter.shared.requestAuthorization(for: .individual) failing to autorize user on real device - iPhone XR (iOS 16.1.2). It does not throw the standard FamilyControlsError which we are handling, but NSCocoaErrorDomain. This is the entire po description: Error Domain=NSCocoaErrorDomain Code=4864 "The given data was not a valid property list." UserInfo={NSCodingPath=(), NSDebugDescription=The given data was not a valid property list., NSUnderlyingError=0x283af4d80 {Error Domain=NSCocoaErrorDomain Code=3840 "Cannot parse a NULL or zero-length data" UserInfo={NSDebugDescription=Cannot parse a NULL or zero-length data}}} The localized one says: "The data couldn’t be read because it isn’t in the correct format." This sounds like some error deep in iOS. The testing device has Apple ID logged in and uses passcode. Anything we can do on our end to solve this issue?
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
3 Replies
913 Views
Hey everyone. My friend and I have an idea of creating an app that allows you to compete against others by seeing who can use certain apps the least. To do this, we need to get the statistics of every app's screen time usage. I looked at doing this through the Screen Time API. However, it isn't very clear to me what app developers can access. Can we access a time breakdown of all apps' screen time usage (similar to the information in the Screen Time Settings screen)? If not, would the best route to manually implement our own tracking system? Thanks!
Posted
by jdholtz.
Last updated
.
Post not yet marked as solved
1 Replies
470 Views
When trying to open an app that uses Local Authentication (FaceID) the auth process does not start right away, 3-4 times trying to auth is needed in order to get authenticated with the method the user has selected (FaceID), this is happening with many apps and seems that there's no a workaround. [Edited by Moderator]
Posted Last updated
.
Post not yet marked as solved
2 Replies
630 Views
Hello, I have an app that you can select apps and then start monitoring. When I restrict the apps by button click, and monitor the activity, the scheduled time works and intervalDidEnd cancels shielding apps. But when I schedule shielding apps, intervalDidStart doesn't start shielding. What am I missing here? I have already added FamilyControls capability. import SwiftUI @main struct TestingScreenTimeAPIApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate var body: some Scene { WindowGroup { ContentView() } } } import SwiftUI struct ContentView: View { @StateObject var model = MyModel.shared @State var isPresented = false var body: some View { VStack { Button("Select Apps") { isPresented = true } .familyActivityPicker(isPresented: $isPresented, selection: $model.selectionToDiscourage) Button("Start monitoring") { model.startMonitoring() } .padding() } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } import Foundation import FamilyControls import DeviceActivity class MyModel: ObservableObject { static let shared = MyModel() private init() {} var selection: FamilyActivitySelection? = nil var selectionToDiscourage = FamilyActivitySelection() { willSet { selection = newValue } } func startMonitoring() { let intervalStart = DateComponents(hour: 11, minute: 09) let intervalEnd = DateComponents(hour: 13, minute: 14) let schedule = DeviceActivitySchedule( intervalStart: intervalStart, intervalEnd: intervalEnd, repeats: true) let center = DeviceActivityCenter() do { try center.startMonitoring(.activity, during: schedule) } catch { print ("Error: \(error)") } } } extension DeviceActivityName { static let activity = Self("activity") } import UIKit import FamilyControls class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { Task { do { try await AuthorizationCenter.shared.requestAuthorization(for: .individual) } catch { print("Error: \(error.localizedDescription)") } } return true } } import DeviceActivity import FamilyControls import ManagedSettings class DeviceActivityMonitorExtension: DeviceActivityMonitor { let store = ManagedSettingsStore() override func intervalDidStart(for activity: DeviceActivityName) { super.intervalDidStart(for: activity) let model = MyModel.shared if model.selection != nil { let applications = model.selection!.applicationTokens store.shield.applications = applications.isEmpty ? nil : applications } } override func intervalDidEnd(for activity: DeviceActivityName) { super.intervalDidEnd(for: activity) store.shield.applications?.removeAll() } }
Posted
by Ismayilov.
Last updated
.
Post not yet marked as solved
0 Replies
289 Views
Hello, I am able to have users properly select apps that my app can limit and block, however I am having a lot of trouble figuring out how to restrict access for set periods of times. For example, I want the user to select the apps they wish to block, store them so they can be reused later and whenever they press a button restrict access for the next 30 minutes. I understand this is doable if they are actively on the app, but I do not know how to automate the lifting of this restriction after the given period. Moreover, what is the best way to persist the category and application tokens selected via the FamilyActivitySelector?
Posted
by gweinz.
Last updated
.
Post not yet marked as solved
0 Replies
303 Views
I'm developing a mental wellness app, and I need to get user's screentime and app usage data and send it to my flask backend for analytics. Is it possible on iphone right now? I've looked into ScreenTime and DeviceActivity frameworks, but they're really poor in terms of examples and documentation, so I'm not sure if this is actually possible or not.
Posted
by teshnizi.
Last updated
.