Calling requestAuthorization() for a child account throws "restricted"?

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.

Answered by Frameworks Engineer in 780146022

Child authorizations in FamilyControls require devices not to be enrolled in mobile device management (MDM). Calling AuthorizationCenter.shared.requestAuthorization(for: .child) while the device is enrolled in MDM will result in FamilyControlsError.restricted. It is likely the app review team is using a device enrolled in MDM for testing, which is causing the enrollment to fail. If that is the case there should be a log that states:

"Family Controls permission requirement is not satisfied (device is managed by MDM)"

If this is not the case, please file a report with Feedback Assistant and attach a sysdiagnose so that we may investigate further.

Accepted Answer

Child authorizations in FamilyControls require devices not to be enrolled in mobile device management (MDM). Calling AuthorizationCenter.shared.requestAuthorization(for: .child) while the device is enrolled in MDM will result in FamilyControlsError.restricted. It is likely the app review team is using a device enrolled in MDM for testing, which is causing the enrollment to fail. If that is the case there should be a log that states:

"Family Controls permission requirement is not satisfied (device is managed by MDM)"

If this is not the case, please file a report with Feedback Assistant and attach a sysdiagnose so that we may investigate further.

Hi, I am trying to make a simple app that just displays the users ScreenTime but I am having trouble finding resources/examples/ on how I can implement the ScreenTime framework. Is there any chance you could share your code so I could learn by viewing it? Thank you in advance

Hi, I am trying to make a simple app that just displays the users ScreenTime but I am having trouble finding resources/examples/ on how I can implement the ScreenTime framework. Is there any chance you could share your code so I could learn by viewing it? Thank you in advance

Just wanted to thank you for taking the time to write this post. An app of ours was also rejected for this reason.

Are you willing to share how it later went for your app, did it ever get approved?

Calling requestAuthorization() for a child account throws "restricted"?
 
 
Q