What's new in Screen Time API

RSS for tag

Discuss the WWDC22 Session What's new in Screen Time API

Posts under wwdc2022-110336 tag

84 Posts

Post

Replies

Boosts

Views

Activity

Allowing notifications to pass through even when apps are hidden via screentime
Our users are constantly asking us to still allow them to receive notifications while the social media apps are hidden from their phone. As an example, they want the instagram app to be hidden from their phone to prevent from habitual scrolling. However, if they did get a message from their friend, they do want to be notified so they can unhide the app & get back to their friend. The same goes for other apps, (facebook, linkedin,....) Hence, we'd love to know if there's currently any way or work around to do this? if not, can we expect this meaningful feedback to built in screentime sooner than later?
1
0
769
Nov ’22
Family Sharing needed on iOS16?
After watching the video "What's new in Screen API", I was convinced that the Screen Time API now opens up for a broader range of apps without the need to involve Family Sharing. Like the example app "Workload" they are using in the video, an app for an individual not involving Family Sharing at all (?) I have now built an app of a similar type, but Apple denied me the Family Controls entitlement "...as your app doesn’t utilize Family Sharing, which is required for Family Controls." I am confused here. Does anyone have more information and/or can explain to me? My, perhaps optimistic, view is that the entitlement request reviewer based their decision on iOS 15 rules rather than the additions made to iOS 16. And input and advice is much appreciated :-)
3
0
1.2k
Oct ’22
Access to screen time granted to an app even when the app has been uninstalled by the user!
HI there, There seems to be a sever bug with family controls API where even when an app has been deleted by the user, the screentime API permission is still granted to deleted app instead of being revoked. The reason for the severity is because when the app user's social media apps per the user's intention, once the user decided to delete the app, the user would no longer be able to access any of their social media despite deleting the app & expecting the permission to be revoked. At the same time, the app can't detect when it has been deleted to unhide the app from user's homescreen. Such bug is happening with other extensions as well (content blockers), where despite the app being deleted, the permission doesn't get revoked.
1
0
1.2k
Oct ’22
Screen Time API: how to customize a cover shield in Xcode 14?
Hi all. I've tried to use Screen Time API from WWDC video https://developer.apple.com/videos/play/wwdc2021/10123/ . In Xcode 14, there is no longer available ShieldConfigurationProvider and ShieldActionHandler from the video. Instead of them we have ShieldActionDelegate and ShieldConfigurationDataSource, but there is no examples and details how to use them. In documentation (links are below) we can see only "create an extension to customize the appearance of the shields" and "Subclass Shield ActionDelegate". I have tried to create extensions but they weren't triggered. I have created subclasses also but It wasn't work and I didn't found any possibility to set custom ShieldConfiguration somewhere https://developer.apple.com/documentation/managedsettingsui/shieldconfigurationdatasource?changes=311 https://developer.apple.com/documentation/managedsettings/shieldactiondelegate So, does anyone had success to customizing ShieldConfiguration in Xcode 14? How did you do this? Should I add something to Info.plist file according to https://developer.apple.com/forums/thread/683110? I already have there <key>NSExtension</key> <dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.deviceactivity.monitor-extension</string> <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).MyDeviceActivityMonitor</string> </dict> I would be grateful for any help and advice, thank you)
1
0
3.0k
Oct ’22
How to show Application Icons within usage report - DeviceActivityReport
I am able to show Device usage in a pie chart / custom view by using DeviceActivityReport extension. DeviceActivityReportScene, DeviceActivityResults every thing is working as expected. I can get application identifier and names from DeviceActivityData but wondering how I can show/get the Application ICON for each app while showing its usage. Apple in its presentation show the custom view that is showing Application icons. I have attached the screen show and also highlighted the App icon section.
1
0
3.5k
Oct ’22
How to hide specific apps from home screen proactively?
I'd like to use screen time Api 16.0 to hide specific apps from the home screen for individuals, not family/parental. I've already written the authentication: let center = AuthorizationCenter.shared try await center.requestAuthorization(for: .individual) But can't figure the doc that shows how to hide/unhide a specific app such as instagram. The closes is familyActivityPicker https://developer.apple.com/documentation/familycontrols/familyactivitypicker but that's for IOS 15.0 API & based on user's selection versus being already pre-configured. AKA, when individual screentime API access given hide all social media apps or hide instagram.
2
0
3k
Oct ’22
What can I do with ShieldActionExtension/ShieldActionDelegate?
I am trying to replicate Screen Time functionality where I open a sheet (or the app) when a user presses a primary or secondary action. However, I am confused on how to do that. What type of actions can I take from ShieldActionDelegate? What is the recommended way to do this? openURL? Making network calls? Is there some other way to communicate with host app other than network calls? I don't think I can use openURL to open the host app? I tried making network calls, but Firebase keychain/appgroup sharing of login state seems to not work (could be my own bug). See screenshot that hints that it should be possible to perform all sorts of actions:
0
2
1.1k
Aug ’22
DeviceActivity monitoring limits
Within the DeviceActivity API, the documentation for DeviceActivityCenter.startMonitoring says: "Attempting to monitor too many activities or activities that are too tightly scheduled can cause this method to throw an error." Is there a documented limit of the amount of activities that are able to be monitored simultaneously? I understand that monitoring "too many activities" will throw an excessiveActivities error, but I can not find documentation that specifically identifies the conditions that this error can be thrown.
1
1
1.4k
Jul ’22
Can I read FamilyActivitySelection the container app saved in the Device Activity Report Extension?
In the container app, use FamilyActivityPicker to select some categories & applications, and set a limit usage time. save the result in UserDefaults. in the DeviceActivityMonitor extension, read the saved selection to present the shield. it works. in the DeviceActivityReportScene extension, read the saved selection, in the report add a special icon for categories & applications with limited usage time. it does not work. in the third step, I can read the saved selection, but I can't match the selected data with DeviceActivityResults in the makeConfiguration function.
1
0
1.9k
Jul ’22
ApplicationActivity.application.localizedDisplayName always nil
When use the DeviceActivity api to create a DeviceActivityReport, all of the ApplicationActivity.application objects have a nil localizedDisplayName. ApplicationActivity(application: ManagedSettings.Application(bundleIdentifier: Optional("com.netflix.Netflix"), token: nil, localizedDisplayName: nil), totalActivityDuration: 0.0, numberOfPickups: 0, numberOfNotifications: 1, isTrusted: true) I see in the documentation for Application.localizedDisplayName the following: In an extension that provides shield configurations, this property provides the app’s name. When you access this property outside that extension, the value is nil. See ShieldConfigurationDataSource in the Managed Settings UI framework for more information. I am using the property in an extension that provides shield configurations so it should not be nil. I do see that ManagedSettings.ActivityCategory.localizedDisplayName is set properly and that in its documentation that it has the same requirement with shield configurations. CategoryActivity(category: ManagedSettings.ActivityCategory(identifier: Optional("DH1003"), token: nil, localizedDisplayName: Optional("Entertainment")), totalActivityDuration: 0.0, applicationActivities: [DeviceActivity.DeviceActivityData.ApplicationActivity(application: ManagedSettings.Application(bundleIdentifier: Optional("com.google.ios.youtube"), token: nil, localizedDisplayName: nil), totalActivityDuration: 0.0, numberOfPickups: 0, numberOfNotifications: 1, isTrusted: true), DeviceActivity.DeviceActivityData.ApplicationActivity(application: ManagedSettings.Application(bundleIdentifier: Optional("com.microsoft.smartglass"), token: nil, localizedDisplayName: nil), totalActivityDuration: 0.0, numberOfPickups: 0, numberOfNotifications: 3, isTrusted: true)], webDomainActivities: []) Since categories' display names are being set correctly, this seems like a bug in the beta to me. Has anyone else seen this issue?
1
1
1.5k
Jul ’22
AuthorizationCenter requestAuthorization returns error 5
AuthorizationCenter.shared.requestAuthorization(for: .individual) returns: (lldb) po error Error Domain=FamilyControls.FamilyControlsError Code=5 "(null)" (lldb) po error.localizedDescription "The operation couldn’t be completed. (FamilyControls.FamilyControlsError error 5.)" What does this error mean? This is on iPadOS Beta 3. Was working fine in Beta 2. More generally, how can one debug such errors? FamilyControlsError exists: https://developer.apple.com/documentation/familycontrols/familycontrolserror But not 100% sure what they map to. I tried mapping them to error codes that I've dug through in the forums but didn't seem to perfectly map. Relevant Tweet: https://twitter.com/vicvijayakumar/status/1495092161821429761
6
0
2.7k
Jul ’22
Settings App getting crashed when Screen time is turned off
Hi Team, I am creating test app with screen time API, after the successful authorization(as child), I tried to turn off screen time under the option available in App. Please find the steps below to repro the crash, Open Settings App after successful authorization Search for the App you have authorized Try turn off the "Screen Time Restriction Settings", it'll turn off Now go to your app Again open the settings app and try to enable the "Screen Time Restriction Settings" Now settings app will get crash. Device : iPad Pro(10.5 inch), iPadOS 16.0 beta
1
0
1.8k
Jul ’22
Having trouble building app after adding DeviceActivity framework
I'm attempting to build with the iOS 16 Screen Time APIs and getting the following error: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/System/Library/Frameworks/DeviceActivity.framework/Modules/module.modulemap:2:10: error build: Header 'DeviceActivity-Swift.h' not found I added the DeviceActivity.framework to the target. Is there a setting I missed or could this be a problem with something missing in the Xcode 14 beta?
1
0
1.4k
Jul ’22
Screen Time API How to send restrict information from parent to child
I want to know the structure how to send restrict information from parent to child. When parent sets restriction on parent's device, that information is reflected on the child's device and the child is restricted from using the app and device. I want to know how the restrictions set on the parent's device are transmitted to the child's device. Also, I want to know how to do it. I could even call requestAuthorization and succeed. Does anyone know this?
4
0
1.7k
Jul ’22
Allowing notifications to pass through even when apps are hidden via screentime
Our users are constantly asking us to still allow them to receive notifications while the social media apps are hidden from their phone. As an example, they want the instagram app to be hidden from their phone to prevent from habitual scrolling. However, if they did get a message from their friend, they do want to be notified so they can unhide the app & get back to their friend. The same goes for other apps, (facebook, linkedin,....) Hence, we'd love to know if there's currently any way or work around to do this? if not, can we expect this meaningful feedback to built in screentime sooner than later?
Replies
1
Boosts
0
Views
769
Activity
Nov ’22
API Screen Time
📣 Hi Folks, Do you know whether or not the following data are available via the screen time API (Family Control)for a 1/3 Party App: of screen un/lock/day of hours & minutes/day of smartphone usage Thank you for your help 😊
Replies
2
Boosts
1
Views
1.1k
Activity
Nov ’22
Family Sharing needed on iOS16?
After watching the video "What's new in Screen API", I was convinced that the Screen Time API now opens up for a broader range of apps without the need to involve Family Sharing. Like the example app "Workload" they are using in the video, an app for an individual not involving Family Sharing at all (?) I have now built an app of a similar type, but Apple denied me the Family Controls entitlement "...as your app doesn’t utilize Family Sharing, which is required for Family Controls." I am confused here. Does anyone have more information and/or can explain to me? My, perhaps optimistic, view is that the entitlement request reviewer based their decision on iOS 15 rules rather than the additions made to iOS 16. And input and advice is much appreciated :-)
Replies
3
Boosts
0
Views
1.2k
Activity
Oct ’22
Access to screen time granted to an app even when the app has been uninstalled by the user!
HI there, There seems to be a sever bug with family controls API where even when an app has been deleted by the user, the screentime API permission is still granted to deleted app instead of being revoked. The reason for the severity is because when the app user's social media apps per the user's intention, once the user decided to delete the app, the user would no longer be able to access any of their social media despite deleting the app & expecting the permission to be revoked. At the same time, the app can't detect when it has been deleted to unhide the app from user's homescreen. Such bug is happening with other extensions as well (content blockers), where despite the app being deleted, the permission doesn't get revoked.
Replies
1
Boosts
0
Views
1.2k
Activity
Oct ’22
Screen Time API: how to customize a cover shield in Xcode 14?
Hi all. I've tried to use Screen Time API from WWDC video https://developer.apple.com/videos/play/wwdc2021/10123/ . In Xcode 14, there is no longer available ShieldConfigurationProvider and ShieldActionHandler from the video. Instead of them we have ShieldActionDelegate and ShieldConfigurationDataSource, but there is no examples and details how to use them. In documentation (links are below) we can see only "create an extension to customize the appearance of the shields" and "Subclass Shield ActionDelegate". I have tried to create extensions but they weren't triggered. I have created subclasses also but It wasn't work and I didn't found any possibility to set custom ShieldConfiguration somewhere https://developer.apple.com/documentation/managedsettingsui/shieldconfigurationdatasource?changes=311 https://developer.apple.com/documentation/managedsettings/shieldactiondelegate So, does anyone had success to customizing ShieldConfiguration in Xcode 14? How did you do this? Should I add something to Info.plist file according to https://developer.apple.com/forums/thread/683110? I already have there <key>NSExtension</key> <dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.deviceactivity.monitor-extension</string> <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).MyDeviceActivityMonitor</string> </dict> I would be grateful for any help and advice, thank you)
Replies
1
Boosts
0
Views
3.0k
Activity
Oct ’22
How to show Application Icons within usage report - DeviceActivityReport
I am able to show Device usage in a pie chart / custom view by using DeviceActivityReport extension. DeviceActivityReportScene, DeviceActivityResults every thing is working as expected. I can get application identifier and names from DeviceActivityData but wondering how I can show/get the Application ICON for each app while showing its usage. Apple in its presentation show the custom view that is showing Application icons. I have attached the screen show and also highlighted the App icon section.
Replies
1
Boosts
0
Views
3.5k
Activity
Oct ’22
FamilyControlsError, Code 7 - what to do about it?
The most common error from AuthorizationCenter.shared.requestAuthorization(for: .individual) my users are getting is: Domain: FamilyControls.FamilyControlsError Code: 7 Error Description: The operation couldn’t be completed. (FamilyControls.FamilyControlsError error 7.) What is that? Could I provide better directions for users if they encounter it?
Replies
1
Boosts
0
Views
1.1k
Activity
Oct ’22
How to hide specific apps from home screen proactively?
I'd like to use screen time Api 16.0 to hide specific apps from the home screen for individuals, not family/parental. I've already written the authentication: let center = AuthorizationCenter.shared try await center.requestAuthorization(for: .individual) But can't figure the doc that shows how to hide/unhide a specific app such as instagram. The closes is familyActivityPicker https://developer.apple.com/documentation/familycontrols/familyactivitypicker but that's for IOS 15.0 API & based on user's selection versus being already pre-configured. AKA, when individual screentime API access given hide all social media apps or hide instagram.
Replies
2
Boosts
0
Views
3k
Activity
Oct ’22
I need to show app usage time in my app
I'm trying to use DeviceActivity but without success, I need an example code
Replies
2
Boosts
0
Views
1.3k
Activity
Sep ’22
Can MDM and screen time co-exists?
Hi, I am trying to use screen time along with MDM, unfortunately I'm not able to install MDM profile. Is there any rules saying MDM and screen time can't co-exist? Thanks
Replies
1
Boosts
0
Views
1.4k
Activity
Sep ’22
Opening the main app from ShieldActionDelegate extension
I noticed on the WWDC video some of the shield screens had “Open App” for buttons, so I assume it’s possible to do so. Is there a code example somewhere?
Replies
1
Boosts
2
Views
1.7k
Activity
Sep ’22
What can I do with ShieldActionExtension/ShieldActionDelegate?
I am trying to replicate Screen Time functionality where I open a sheet (or the app) when a user presses a primary or secondary action. However, I am confused on how to do that. What type of actions can I take from ShieldActionDelegate? What is the recommended way to do this? openURL? Making network calls? Is there some other way to communicate with host app other than network calls? I don't think I can use openURL to open the host app? I tried making network calls, but Firebase keychain/appgroup sharing of login state seems to not work (could be my own bug). See screenshot that hints that it should be possible to perform all sorts of actions:
Replies
0
Boosts
2
Views
1.1k
Activity
Aug ’22
DeviceActivity monitoring limits
Within the DeviceActivity API, the documentation for DeviceActivityCenter.startMonitoring says: "Attempting to monitor too many activities or activities that are too tightly scheduled can cause this method to throw an error." Is there a documented limit of the amount of activities that are able to be monitored simultaneously? I understand that monitoring "too many activities" will throw an excessiveActivities error, but I can not find documentation that specifically identifies the conditions that this error can be thrown.
Replies
1
Boosts
1
Views
1.4k
Activity
Jul ’22
Can I read FamilyActivitySelection the container app saved in the Device Activity Report Extension?
In the container app, use FamilyActivityPicker to select some categories & applications, and set a limit usage time. save the result in UserDefaults. in the DeviceActivityMonitor extension, read the saved selection to present the shield. it works. in the DeviceActivityReportScene extension, read the saved selection, in the report add a special icon for categories & applications with limited usage time. it does not work. in the third step, I can read the saved selection, but I can't match the selected data with DeviceActivityResults in the makeConfiguration function.
Replies
1
Boosts
0
Views
1.9k
Activity
Jul ’22
ApplicationActivity.application.localizedDisplayName always nil
When use the DeviceActivity api to create a DeviceActivityReport, all of the ApplicationActivity.application objects have a nil localizedDisplayName. ApplicationActivity(application: ManagedSettings.Application(bundleIdentifier: Optional("com.netflix.Netflix"), token: nil, localizedDisplayName: nil), totalActivityDuration: 0.0, numberOfPickups: 0, numberOfNotifications: 1, isTrusted: true) I see in the documentation for Application.localizedDisplayName the following: In an extension that provides shield configurations, this property provides the app’s name. When you access this property outside that extension, the value is nil. See ShieldConfigurationDataSource in the Managed Settings UI framework for more information. I am using the property in an extension that provides shield configurations so it should not be nil. I do see that ManagedSettings.ActivityCategory.localizedDisplayName is set properly and that in its documentation that it has the same requirement with shield configurations. CategoryActivity(category: ManagedSettings.ActivityCategory(identifier: Optional("DH1003"), token: nil, localizedDisplayName: Optional("Entertainment")), totalActivityDuration: 0.0, applicationActivities: [DeviceActivity.DeviceActivityData.ApplicationActivity(application: ManagedSettings.Application(bundleIdentifier: Optional("com.google.ios.youtube"), token: nil, localizedDisplayName: nil), totalActivityDuration: 0.0, numberOfPickups: 0, numberOfNotifications: 1, isTrusted: true), DeviceActivity.DeviceActivityData.ApplicationActivity(application: ManagedSettings.Application(bundleIdentifier: Optional("com.microsoft.smartglass"), token: nil, localizedDisplayName: nil), totalActivityDuration: 0.0, numberOfPickups: 0, numberOfNotifications: 3, isTrusted: true)], webDomainActivities: []) Since categories' display names are being set correctly, this seems like a bug in the beta to me. Has anyone else seen this issue?
Replies
1
Boosts
1
Views
1.5k
Activity
Jul ’22
AuthorizationCenter requestAuthorization returns error 5
AuthorizationCenter.shared.requestAuthorization(for: .individual) returns: (lldb) po error Error Domain=FamilyControls.FamilyControlsError Code=5 "(null)" (lldb) po error.localizedDescription "The operation couldn’t be completed. (FamilyControls.FamilyControlsError error 5.)" What does this error mean? This is on iPadOS Beta 3. Was working fine in Beta 2. More generally, how can one debug such errors? FamilyControlsError exists: https://developer.apple.com/documentation/familycontrols/familycontrolserror But not 100% sure what they map to. I tried mapping them to error codes that I've dug through in the forums but didn't seem to perfectly map. Relevant Tweet: https://twitter.com/vicvijayakumar/status/1495092161821429761
Replies
6
Boosts
0
Views
2.7k
Activity
Jul ’22
Settings App getting crashed when Screen time is turned off
Hi Team, I am creating test app with screen time API, after the successful authorization(as child), I tried to turn off screen time under the option available in App. Please find the steps below to repro the crash, Open Settings App after successful authorization Search for the App you have authorized Try turn off the "Screen Time Restriction Settings", it'll turn off Now go to your app Again open the settings app and try to enable the "Screen Time Restriction Settings" Now settings app will get crash. Device : iPad Pro(10.5 inch), iPadOS 16.0 beta
Replies
1
Boosts
0
Views
1.8k
Activity
Jul ’22
Having trouble building app after adding DeviceActivity framework
I'm attempting to build with the iOS 16 Screen Time APIs and getting the following error: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/System/Library/Frameworks/DeviceActivity.framework/Modules/module.modulemap:2:10: error build: Header 'DeviceActivity-Swift.h' not found I added the DeviceActivity.framework to the target. Is there a setting I missed or could this be a problem with something missing in the Xcode 14 beta?
Replies
1
Boosts
0
Views
1.4k
Activity
Jul ’22
does FamilyControlsMember.individual mode prevent user from disabling the block?
the video mentioned that in .individual mode you can logout of icloud and delete apps (i.e. delete the blocker app (?)). is this during the block?
Replies
2
Boosts
0
Views
987
Activity
Jul ’22
Screen Time API How to send restrict information from parent to child
I want to know the structure how to send restrict information from parent to child. When parent sets restriction on parent's device, that information is reflected on the child's device and the child is restricted from using the app and device. I want to know how the restrictions set on the parent's device are transmitted to the child's device. Also, I want to know how to do it. I could even call requestAuthorization and succeed. Does anyone know this?
Replies
4
Boosts
0
Views
1.7k
Activity
Jul ’22