Contents

activityData(filteredBy:using:)

Requests device activity data using a filter.

Declaration

static func activityData(filteredBy filter: DeviceActivityFilter = .init(), using policy: DeviceActivityData.Policy = .cached) -> some AsyncSequence<DeviceActivityData, any Error>

Parameters

  • filter:

    The filter to use when fetching activity data.

  • policy:

    The policy to use when fetching activity data.

Return Value

A sequence of device activity data for the given filter.

Discussion

Use this method to export family activity data, for use in another app or platform.

Region support, authorization, and entitlement

You can develop and test an app that uses this method on devices in any region. Customer installations of your app can only use the method on devices located in the EU that are signed in with an Apple Account with an EU country or region. Otherwise, it throws an error.

Your app’s authorization status needs to be AuthorizationStatus.approvedWithDataAccess to use this method.

Your app needs the Family Controls App and Website Usage entitlement to use this method. Enable the capability on your Xcode target to add the entitlement to your app. For more information, see Adding capabilities to your app.