FamilyControlsError Code=2 on Parent's Device

I have tried to use Screen Time API. The problem is that I can't get access to FamilyControl framework on parent's device. What should I do to get access?

class AppDelegate: NSObject, UIApplicationDelegate {

   
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {

        AuthorizationCenter.shared.requestAuthorization { res in

            switch res {
            case .success():
                print("===SUCCESS AUTHORIZATION===")
            case .failure(let error):
                print(error.localizedDescription)
            }
        }

        return true
    }
}
Answered by vova085 in 692823022

AuthorizationCenter.shared.requestAuthorization can only used on a device with Child iCloud account. It can not be used on Parent's device. Purpose of this request is to Authorize A parent iCloud account on child device so that a parent can supposedly manage the child ScreenTime

quoting an answer i got for this question from: AsifmDev

Accepted Answer

AuthorizationCenter.shared.requestAuthorization can only used on a device with Child iCloud account. It can not be used on Parent's device. Purpose of this request is to Authorize A parent iCloud account on child device so that a parent can supposedly manage the child ScreenTime

quoting an answer i got for this question from: AsifmDev

FamilyControlsError Code=2 on Parent's Device
 
 
Q