Post not yet marked as solved
I got a client request to build a parental control app like Parentkit(https://parentkit.co/) or Ourpact (http://ourpact.com/) to help parents manage their children devices. After doing some research online, I figured that it could be a MDM feature and requires an apple enterprise account for implementation. However, Apple developer program support does not allow me to create an enterprise account for developing a MDM system for non-company members. They also said that any non-company use of MDM is not allowed by Apple. If what they said is true, MDM implementation should not be allowed in the abovementioned parental control apps. Would they be using other means without the need to register an enterprise account to archieve real-time, over-the-air control on device restriction? If that is the case, what else I should read and work on to build a parental control apps like those without registering an enterprise account?
Post not yet marked as solved
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?
Post not yet marked as solved
Hi Team,
With the new Screen Time API, I have a question: with DeviceActivity, will the parent have access to DeviceActivity Data and DeviceActivity report of his children?
Post not yet marked as solved
I'm attempting to authorize family controls as .individual in the latest Xcode 14 beta (14A5228q).
do {
try await AuthorizationCenter.shared.requestAuthorization(for: .individual)
} catch {
print(error.localizedDescription)
dump(error)
}
Running this on the iPhone 13 Simulator (iOS 16), it throws the following error:
The operation couldn’t be completed. (FamilyControls.FamilyControlsError error 3.)
- Error Domain=FamilyControls.FamilyControlsError Code=3 "(null)" #0
- super: NSObject
I have a dedicated App ID and have enabled the "Family Controls" capability.
An Apple Systems Engineer suggested in this thread that "Requesting FamilyControls authorization on Simulator is supported by the ScreenTime API", although they don't say whether it actually works or not.
The rest of the thread seems to suggest people are also having issues when running on a physical device so I'm reluctant to install the iOS 16 Beta as I use my phone daily for work projects.
Is this FamilyControls authorization supposed to work in Simulator and are there any special considerations when authorizing as .individual?
Post not yet marked as solved
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?
The FamilyActivityPicker only allows to select applications & their categories (tested on iPad). However, the docs say:
A view in which users specify applications, web domains, and categories without revealing their choices to the app.
Where can I select web domains in the FamilyActivityPicker?
Then, it seems like ManagedSettingsStore can only be used with tokens. It can't be used with explicitly initialized WebDomain structs. For example, managedSettingsStore.webDomains = [WebDomain(domain: "bad website")] is not possible to do? As a result, without the ability to get website tokens, it seems impossible to shield websites? However, it does seem possible to block websites with the web filter.
Post not yet marked as solved
Hello,
Is it possible to make a FaceID authentication (LAContext) inside the ShieldActionDelegate extension in the func handle(action: ShieldAction...) callback?
Or is it possible to open the host app to do this authentication for us?
Right now using LAContext.evaluatePolicy (with FaceID) gives this error: User interaction required. And there is no API to open the host app.
Or any other ideas how to have some extra options/operations in the handle caller?
Thank you
2022-06-15 13:19:43.606183-0400 App Name Notification test[594:18404] [UIFocus] TtGC7SwiftUI14_UIHostingViewGVS_15ModifiedContentVS_7AnyViewVS_12RootModifier_ implements focusItemsInRect: - caching for linear focus movement is limited as long as this view is on screen.
2022-06-15 13:19:43.677534-0400 App Name Notification test[594:18436] [xpc] Connection error from Optional("com.apple.FamilyControlsAgent"): Couldn’t communicate with a helper application.
Attempts remaining: 1
Failed to enroll Luis with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.FamilyControlsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.FamilyControlsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction.}
Post not yet marked as solved
Hello,
Is it possible to make a FaceID authentication (LAContext) inside the ShieldActionDelegate extension in the func handle(action: ShieldAction...) callback?
Or is it possible to open the host app to do this authentication for us? Right now using LAContext.evaluatePolicy (with FaceID) gives this error: User interaction required. And there is no API to open the host app.
Or any other ideas how to have some extra options/operations in the handle caller?
Thank you
I am unable to make any progress regarding DeviceActivityReport. The session from WWDC 2022 covers it very briefly.
What I (hopefully correctly) understood is that we need to create an extension of type Activity report and inside it implement the body which is DeviceActivityReportScene that will display the charts and what not.
And then in the app, we need to use DeviceActivityReport with SwiftUI to show the report which will be run in sandbox from the extension.
But I cannot get anything to show up on the screen. Even when my extension view is just a static text to verify something gets displayed.
I am trying to create the device activity report without any filter which should give me all activity data per the docs.
This is shown in the Xcode console for the view that uses DeviceActivityReport.
2022-06-17 18:08:47.219785+0200 DeviceActivityTest[9613:954204] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
2022-06-17 18:08:47.219862+0200 DeviceActivityTest[9613:954204] [default] Attempt to map database failed: permission was denied. This attempt will not be retried.
2022-06-17 18:08:47.219911+0200 DeviceActivityTest[9613:954204] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
2022-06-17 18:08:47.290070+0200 DeviceActivityTest[9613:954204] [default] Remote viewcontroller request failed: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 9615 named com.apple.DeviceActivityUI.DeviceActivityReportService.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service with pid 9615 named com.apple.DeviceActivityUI.DeviceActivityReportService.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.}
Post not yet marked as solved
Hello,
When locking an app using Family Controls, inside the ShieldActionDelegate's handle(action:..) call (where we decide what to do with the shielded app) there is no way to call Face ID (LAContext). The error is: User interaction is required.
I understand why this is the case, but is there any other way around this?
Sometimes handle(action:) inside ShieldActionDelegate needs authentication or more details from the user in order to decide if the app should be unlocked.
Thank you.
Post not yet marked as solved
Hi!
I'm playing around with the Screen Time API. I would like to let my app notify me every time I have used my device for 1 minute (any app). When I have been notified, I would like to reset the monitoring so that I will be notified again after another minute using my device.
I'm not sure how to accomplish this. In the main app, I currently start monitoring the following event with a schedule:
let event = DeviceActivityEvent(threshold: DateComponents(minute: 1))
let schedule = DeviceActivitySchedule(intervalStart: DateComponents(hour: 0, minute: 0, second: 1), intervalEnd: DateComponents(hour:23, minute: 59, second: 59), repeats: true)
Then, in the Device Activity Monitor Extension, I restart the same monitoring once the threshold is reached in eventDidReachThreshold.
However, eventDidReachThreshold is being called much more than once an hour. I have checked that I only have one monitoring event running, so duplicates does not seem to be a problem. So, my questions are:
Does my approach look OK? What am I missing?
Would this monitoring collect usage from all devices connected to the same Apple ID, i.e. my Mac, iPad, iPhones etc? If so, how can I make it only monitor usage on one of my devices (the iPhone running the app)?
Post not yet marked as solved
Looks like a bug to me.
when i go to manage my child’s screen time and select Communication limits -> During Downtime after entering screen time pin the application crashes.
i’m using iphone Xs with latest ios 15.5 (19F77).
Post not yet marked as solved
To shield applications, we have to pass ApplicationTokens to DeviceAcvivityMonitorExtension. But I don't know the way.
I tried to pass it by using NSUserDefaults. However, it didn't work because ApplicationToken isn't encodable. So I can't save it in UserDefaults
Does anyone knows the way to pass ApplicationTokens to the Extension or another way to shield apps?
Post not yet marked as solved
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?
Post not yet marked as solved
I've been trying to get something to work with the Screen Time API, but almost everything related to it is unimplemented.
I checked following links
Device Activity
https://developer.apple.com/documentation/DeviceActivity
Managed Settings
https://developer.apple.com/documentation/ManagedSettings
Family Control
https://developer.apple.com/documentation/FamilyControls
Checked videos
https://developer.apple.com/videos/play/wwdc2022/110336/
Problems I faced
FamilyActivityPicker does not list installed apps on either of the guardian's or child's devices, it only lists the categories.
There is no way to allow setting up of restrictions for individual kids, if we have many kids in family.
If anyone gone through the same problem please upvote or if anyone has a solution please share
Thanks
Post not yet marked as solved
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
Post not yet marked as solved
Hi! DeviceActivityMonitors methods IntervalDidStart, IntervalDidEnd and eventDidReachThreshhold do not seem to be called on my application. Has anyone found a solution to this problem. Thank you in advance.