One Logo Pool Ball
DeviceActivity · IOS API REFERENCE

DeviceActivityData

struct · iOS 16.0+ · SDK 27.1

struct DeviceActivityData

Represents the activity of a ``User`` on a particular ``Device``.

Members (9)

static · iOS 26.4+

activityData

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

Request device activity data using a filter. > Important: You must add the Family Controls App & Website Usage capability to your app before you attempt to use this function. This capability adds the <doc://com.apple.documentation/documentation/bundleresources/entitlements/com_apple_developer_family-controls_app-and-website-usage> to your app. In a compatible iPad or iPhone app running on visionOS or macOS, using this function will always throw. For more information, see <doc://com.apple.documentation/documentation/xcode/adding-capabilities-to-your-app/>. Additionally, your app must be authorized and data access must be available before using this function, or it will always throw. See <doc://com.apple.documentation/documentation/familycontrols/authorizationcenter> for more details. - Parameters: - filter: The filter to use when fetching activity data. - policy: The policy to use when fetching activity data. - Returns: A sequence of device activity data for the given filter.

get · iOS 16.0+

lastUpdatedDate

TypeScript
get lastUpdatedDate(): globalThis.Date
Swift declaration
var lastUpdatedDate: Date

The date when the system last updated the data for this device.

set · iOS 16.0+

lastUpdatedDate

TypeScript
set lastUpdatedDate(value: globalThis.Date)
Swift declaration
var lastUpdatedDate: Date

The date when the system last updated the data for this device.

get · iOS 16.0+

segmentInterval

TypeScript
get segmentInterval(): DeviceActivityFilter_SegmentInterval
Swift declaration
var segmentInterval: DeviceActivityFilter.SegmentInterval

The segment interval of each ``ActivitySegment`` in ``activitySegments``.

set · iOS 16.0+

segmentInterval

TypeScript
set segmentInterval(value: DeviceActivityFilter_SegmentInterval)
Swift declaration
var segmentInterval: DeviceActivityFilter.SegmentInterval

The segment interval of each ``ActivitySegment`` in ``activitySegments``.

get · iOS 16.0+

user

TypeScript
get user(): DeviceActivityData_User
Swift declaration
var user: DeviceActivityData.User

The user associated with the activity report.

set · iOS 16.0+

user

TypeScript
set user(value: DeviceActivityData_User)
Swift declaration
var user: DeviceActivityData.User

The user associated with the activity report.

get · iOS 16.0+

device

TypeScript
get device(): DeviceActivityData_Device
Swift declaration
var device: DeviceActivityData.Device

The device associated with the activity report.

set · iOS 16.0+

device

TypeScript
set device(value: DeviceActivityData_Device)
Swift declaration
var device: DeviceActivityData.Device

The device associated with the activity report.

Skipped declarations

No declarations were skipped in this snapshot.

All DeviceActivity types →