Why calling requestAuthorization() for a child account throws "restricted" error in ScreenTime API?

73 views Asked by At

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) 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 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.

1

There are 1 answers

1
maxbk On

This happened because Apple review team was testing the app on the device enrolled in the mobile device management.

Link to the answer on the Apple forum: https://developer.apple.com/forums/thread/746716