List of Apps selected from Family Activity Picker from a parent/guardian device is empty

Hi,

I am implementing ScreenTime API and I have a very specific issue regarding the Family Activity Picker from FamilyControls on iOS.

The issue is regarding the callback from the Family Activity Picker when displayed from a Guardian/Parent device.

When Apps are selected from a parent/guardian iPhone in order to restrict them in the child's iPhone.

The onChange callback is giving an empty set of applications tokens. whereas when the same code runs on the child devices, set apps tokens are not empty but are useless as I need to have this in the parent device.

Here below, this below is the log printed from the code ( see below) when it is run on a parent device.

FamilyActivitySelection(includeEntireCategory: true, applicationTokens: Set([]), categoryTokens: Set([]), webDomainTokens: Set([])

Full code example:

    @State private var isDiscouragedPresented = false
    @State private var isEncouragedPresented = false

    @EnvironmentObject var model: MyModel

    var body: some View {
        VStack {
            Button("Select Apps to Discourage") {
                isDiscouragedPresented = true
            }
            .familyActivityPicker(isPresented: $isDiscouragedPresented, selection: $model.selectionToDiscourage)

            Button("Select Apps to Encourage") {
                isEncouragedPresented = true
            }
            .familyActivityPicker(isPresented: $isEncouragedPresented, selection: $model.selectionToEncourage)
        }
        .onChange(of: model.selectionToDiscourage) { newSelection in
            print(newSelection)
            MyModel.shared.setShieldRestrictions()
        }
    }
}

Why this issue is happening on the parent/guardian devices?

A side note, as it might help some of you to answer my question.

The AuthorizationCenter authorization is returning an error when run on the parent device and AuthorizationStatus stays at “Not Determined”, whereas on the Child device authorization is getting the approved status.

My logic made me think that there is an Apple bug and maybe an Apps list callback from the Family Activity picker might be using the authorization status.

Does anyone has faced that particular issue, and might be able to solve it ?

I am happy to share more code if needed.

Both devices (Parent and Child) are using iOS 15.4. the issue was still there is iOS < 15.4.

Thanks !

Did you add the capability to the project and did you request access to the entitlement from: https://developer.apple.com/contact/request/family-controls-distribution

Hi,

Yes, I had requested access for the entitlement and this capability has been correctly added to the app identifier additional capabilities in the developer account for the correct bundleID.

In the project, I can see the proper capabilities have been added without any issue.

But still when running the project from the Parent Device I am still facing this issue when selection of apps is getting done from the FamilyPicker Activity :

FamilyActivitySelection(includeEntireCategory: true, applicationTokens: Set([]), categoryTokens: Set([]), webDomainTokens: Set([]))

Is there any other things that can cause that from the Guardian/Parent devices? (From the child device we get the App Token and the Set is not empty)

Also, something worth mentioning is that the .onChange is not getting called. I got the result from the MyModel class which subscribes to it.

From the documentation the onChange() method should be called after the Done button been selected

Hi  MohamediOS!

You get an empty set of applications tokens because the parent app is not authorized and you can't get it authorized at all. I think that apple did this from security issues and you can see this even on an authorized child that the applications tokens set is not empty but it's encrypted. So i believe you can't get this list on a Non authorized app at this moment maybe apple will be nice and make an api change that we can retrieve this information on a connected users threw the family sharing or something.

I'm also facing the same problem on the parent device. The Activity picker displaying all apps from the child device, but $selection is empty, also onChange() didn't trigger. But the same is working properly on the child device. (Both running 15.4.1). Also, I have a query, anyone know how to create Application/ApplicationToken instance from the token received from the ActivityPicker ? I'm planning to pass this token to the child device somehow. But here is no documentation about how to serialize/deserialize the tokens. Anyone managed to store/send the tokens from one device to another ? Thanks :)

I have a good news.

After testing on iOS 16 Public Beta, this issue is now fixed. App Tokens are now given within the familyActivityPicker callback.

Hello,is the problem solved now? How can parents APP block the applications on the child's device

List of Apps selected from Family Activity Picker from a parent/guardian device is empty
 
 
Q