Family Controls: `authorizationStatus` and `requestAuthorization` beyond dysfunctional

The functionality of authorizationStatus and requestAuthorization is completely broken. I'm using Xcode 15.3 and iOS 17.4.

Does anyone have a solution?

authorizationStatus doesn't behave as promised

  1. Revoking authorization in the system-wide settings does not change the authorizationStatus while the app is not closed. Calls to center.authorizationStatus will still return .approved instead of .denied.

  2. Even closing and relaunching the app after revoking authorization does not work: authorizationStatus is then .notDetermined when it should be .denied.

  3. Tapping "Don't Allow" in the alert shown after an initial call to requestAuthorization leaves the authorizationStatus unchanged, i.e. at .notDetermined. This is contrary to the promised outcome .denied (defined as: "The user, parent, or guardian denied the request for authorization") and contrary to the definition of .notDetermined (defined as: "The app hasn’t requested authorization", when it just did).

  4. Same issue when first tapping "Continue" followed by "Don't Allow" on the next screen.

As a consequence of authorizationStatus being broken, its publisher $authorizationStatus is worthless too.

requestAuthorization doesn't behave as promised

This is most likely a consequence of the corrupted authorizationStatus: when revoking authorization in the system-wide settings, a call to requestAuthorization opens the authorization dialogue instead of doing nothing. It is thus possible to repeatedly ask a user to authorize Family Controls.

Code sample

To reproduce, create a new SwiftUI app, add the "Family Controls" capability and a button executing the following task when tapped:

let center = AuthorizationCenter.shared
var status = center.authorizationStatus
print(status)
do {
    try await center.requestAuthorization(for: .individual)
    print("approved")
} catch {
    print("denied")
}
status = center.authorizationStatus
print(status)
Post not yet marked as solved Up vote post of principled Down vote post of principled
244 views
  • Same issue here. Posted a thread about this and nothing from the apple developers/admin answers the questions. This forum should be renamed TRASH FORUM instead of DEVELOPER FORUM

Add a Comment

Replies

The Screen Time API is so broken.

I have filed many feedback requests.

No replies.

No bug fixes.

I wonder if someone actually works on this.

  • I wonder if someone actually works on this.

    Same.

Add a Comment