Unable to load Family Activity Picker ScreenTimeAPI

I've created a test project in which I can successfully receive the FamilyControl authorization for the child device.

Then on the parent device(where the parent account is logged in as the iCloud account), I basically used the following test code as provided in the documentation FamilyActivityPicker

struct ExampleView: View {
  @State var selection = FamilyActivitySelection()
  @State var isPresented = false

  var body: some View {
    Button("Present FamilyActivityPicker") { isPresented = true }
    .sheet(isPresented: $isPresented) {
      FamilyActivityPicker(selection: $selection)
    }
    .onChange(of: selection) { newSelection in
      let applications = selection.applications
      let categories = selection.categories
      let webDomains = selection.webDomains
    }
  }
}

I get the following error on the view :

The operation couldn't be completed. (FamilyControls.ActivityPickerRemoteViewError error 1)

For authorization errors I was able to look into the FamilyControlsError enum in the FamilyControls framework, but I can't find an enum for ActivityPickerRemoteViewError.

Any idea as to why it's failing to load?

I believe I am using the right setup in terms of the account that I am logged in to. I do have the FamilyControl capability, and I was able to successfully provide authorization for the child. Is there any other prerequisite that needs to be done to load the FamilyActivityPicker?

Also, Do you know where I can find the error codes corresponding to ActivityPickerRemoteViewError ?

What does error 1 indicate?

I do see the following in the console logs :

2021-06-09 16:42:38.430112-0400 NN Family Control[849:38700] [lifecycle] [u 9F1F2B94-76F6-4D8F-ADE3-6D1C14EE5074:m (null)] [com.apple.FamilyControls.ActivityPickerExtension(1)] Connection to plugin interrupted while in use.
2021-06-09 16:42:38.476929-0400 NN Family Control[849:38704] [lifecycle] [u 9F1F2B94-76F6-4D8F-ADE3-6D1C14EE5074:m (null)] [com.apple.FamilyControls.ActivityPickerExtension(1)] Connection to plugin invalidated while in use.

Replies

Looks like this is fixed as of Beta 5. Anyone else tried it?

  • @nmik2020 I'm seeing the same behavior on beta 5 that I was seeing on beta 4. FamilyActivityPicker works on child device but not on parent device. Are you saying that you're getting the picker to work properly on the parent device (it shows apps that you can pick)?

  • Yea I am able to see the list of apps on the parent device.

  • Are you sure the child apps are listed on the parent device? I can only see the categories, when I expand them, they are always empty.