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.
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
Hello,
I am not quite sure, how the shielding of entire categories of apps is supposed to work. The FamilyActivitySelection contains tokens for apps, websites and categories.
But the shield property of ManagedSettingsStore has only attributes applications and webDomains where I can configure the tokens from the family activity selection.
shield.applications = selection.applicationTokens
shield.webDomains = selection.webDomainTokens
I would expect there to be the property categories that expects Set<ActivityCategoryToken> and based on this shields apps in that category.
Post not yet marked as solved
Where can I download screentime demo 'Worklog'? I couldn't found it on sample section? Apple didn't provide demo for ScreenTime in last WWDC neither.
Post not yet marked as solved
Hi,
I am implementing ScreenTime API and I have a very specific issue regarding the Family Activity Picker from FamilyControls on iOS.
The issue is regarding the callback from the Family Activity Picker when displayed from a Guardian/Parent device.
When Apps are selected from a parent/guardian iPhone in order to restrict them in the child's iPhone.
The onChange callback is giving an empty set of applications tokens. whereas when the same code runs on the child devices, set apps tokens are not empty but are useless as I need to have this in the parent device.
Here below, this below is the log printed from the code ( see below) when it is run on a parent device.
FamilyActivitySelection(includeEntireCategory: true, applicationTokens: Set([]), categoryTokens: Set([]), webDomainTokens: Set([])
Full code example:
@State private var isDiscouragedPresented = false
@State private var isEncouragedPresented = false
@EnvironmentObject var model: MyModel
var body: some View {
VStack {
Button("Select Apps to Discourage") {
isDiscouragedPresented = true
}
.familyActivityPicker(isPresented: $isDiscouragedPresented, selection: $model.selectionToDiscourage)
Button("Select Apps to Encourage") {
isEncouragedPresented = true
}
.familyActivityPicker(isPresented: $isEncouragedPresented, selection: $model.selectionToEncourage)
}
.onChange(of: model.selectionToDiscourage) { newSelection in
print(newSelection)
MyModel.shared.setShieldRestrictions()
}
}
}
Why this issue is happening on the parent/guardian devices?
A side note, as it might help some of you to answer my question.
The AuthorizationCenter authorization is returning an error when run on the parent device and AuthorizationStatus stays at “Not Determined”, whereas on the Child device authorization is getting the approved status.
My logic made me think that there is an Apple bug and maybe an Apps list callback from the Family Activity picker might be using the authorization status.
Does anyone has faced that particular issue, and might be able to solve it ?
I am happy to share more code if needed.
Both devices (Parent and Child) are using iOS 15.4. the issue was still there is iOS < 15.4.
Thanks !
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?
As per Apple documentation , AuthorizationCenter API's.
func requestAuthorization(completionHandler:) is available on iOS 15.0 and deprecated on iOS16.0.
func requestAuthorization(for:) is available on iOS 16.0 and Later, but this API in still in Beta.
For an app that is targeting to release now(before 16.0 release), how do we code?
It appears that, if we use first api, it will deprecate when 16.0 comes and we don't know how it behave in 16.0.
For second api,we can't use 16.0 API, as its a Beta API now.It is a subject to change.
For first API, it is deprecated, for the second api, it is still in beta.
Question is, What is the best way to handle this in code, with minimum future updates to App?
Anyone from Family Controls team, Pls guide.
Thanks.
Post not yet marked as solved
Hi,
Has anyone managed to store applications, categories or webDomains from FamilyActivitySelection into UserDefaults ?
Application or Category is not Codable. How do we encode this into JSON?
Thanks for your help
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?
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
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
I started seeing failures authenticating to FamilyControls on a test device and I think I've tracked it down to the underlying FamilyControlsAgent process crashing:
Terminating app due to uncaught exception 'CKException', reason: 'recordName (AAAAAAAAAAAAAAAADH0toCzCpPWEtIr89SNmamgacnXdKjEEhIjr/hu5Hm1Rdg85TfYRKG6o9DcxOOuAXBsJp+1+Fcd/8vYor2SXoOuRNN06PQNsv3sVy9ifrjzFU1l29ZrB68jM5P1Z9JhvvQhB57htPPSwKew8ZjYZKI2a6EUnc9f7TpevWkuvNPtJUUOY6H/Zmh66KXgCySiMv5c32kItb5/CB+hWPOb9u44NxGultUqMhzciWjNfitDXo28sxD4ktFf2Afd0+xO2GCkYlSyP8uxV/SHC/tc2o91EV2z+z9fq) is too long'
I can't imagine what I might have fed it from my to cause it to generate such a name, and 15.4 seems to be working just fine with the same code.
Any ideas?
Post not yet marked as solved
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?
Post not yet marked as solved
I am building an app that uses DeviceActivity framework. Looking at the documentation, I need to subclass (https://developer.apple.com/documentation/deviceactivity/deviceactivitymonitor), I need to "subclass DeviceActivityMonitor and designate the subclass as the principal class of my app extension.
I am wondering how to designate my subclass as the principal class. (I am new to iOS development :) .
Hi everyone,
I am trying to change the settings when the shield button is clicked.
When I called let store = ManagedSettingsStore() in the ShieldAction extension, store.shield.applications is nil. How can I access the instance created in the host app?
Besides, has anyone ever tried to change the shield UI after clicking a button on the shield screen? I've searched around but no luck. is there any way I can notify the host app for further actions? Any help would be appreciated! Thank you very much.
Sorry I don't know why I can't add the wwdc21-10123 tag.
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
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
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
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