@jimm123034
Try to create the project as below,
Create a new project as Single App
Enable Family Control capabilities
Now add required frameworks one by one and activate it.
I used Xcode 14.3beta
Post
Replies
Boosts
Views
Activity
https://github.com/agarrharr/Homework
Just try this out..
@kgaidis
Please find the error code mapping below,
enum FamilyControlsError : LocalizedError {
case restricted
case unavailable
case invalidAccountType
case invalidArgument
case authorizationConflict
case authorizationCanceled
case networkError
@available(iOS 16.0, *)
case authenticationMethodUnavailable
}
For your case error is like "The parent or guardian canceled a request for authorization."
Do one thing, remove the app and try install it again. Do you able to see the alert dialogue asking for authentication?
@yuraist
I am trying hard to bring the child application lists on parent device, but unfortunately I am not able to do so. Both Child and guardian/parent device are in same iOS version (15 latest).
Any separate configuration to make in parent app?
Thanks
Any findings or update you got respect to developing guardian app using screen time api?
I am able to block the app with the above code, what I missed was Family control capability not added in Device Activity Monitor extensions.
If you are getting the above error, it could be because of Family control capability is not added in extensions.
Apple didn't share any demo app for Screen Time API as far as I know.
We're creating test apps based on the code shown in WWDC as well as information shared in wwdc21-10123 forum tag.
My suggestion just go through all the topic listed under the forum tag wwdc21-10123, you'll have fair idea.
Hi,
Any update on the above issue? I am also trying to block application in the same way but I am getting different error,
Attempts remaining: 1
Failed to fetch effective value for com.apple.ManagedSettings.effective-media-settings.changed: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.ManagedSettingsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.ManagedSettingsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction.}```
could you please guide me if I'm missing something?
Are you trying to run it in simulator? Try it in real device with child Apple account(has to be part of family sharing) logged in.
When, I ran it in simulator received the same error code 3 for the domain FamilyControls.FamilyControlsError.
Hi,
One of my friend suggested to debug extension process and check console which helped.
I received the call back to the code and while observing console logs expected events fired for start and end.
But I am not sure why print statement doesn't print any from extension principal class file.
Console logs under the process 'DeviceActivityMonitorExtension' below,
Interval started for daily
Interval ended for daily
Hope this will help.
Hi,
I too faced the problem, one of my friend suggested to debug extension process and check console which helped.
I received the call back to the code and while observing console logs expected events fired for start and end.
Raised this thread too - https://developer.apple.com/forums/thread/689460
Console logs under the process 'DeviceActivityMonitorExtension' below,
Interval started for daily
Interval ended for daily
Hope this will help.