TechnologiesApp Extensions & System Integration

DeviceActivity

iOSmacOStvOSwatchOSvisionOS

DeviceActivity lets an extension monitor and respond to scheduled Screen Time device-activity intervals and usage events on iOS, macOS, and watchOS. You define a DeviceActivitySchedule and DeviceActivityEvent, then register them with a DeviceActivityCenter under a DeviceActivityName so your extension is invoked when an interval begins or ends or a usage threshold is reached. To present collected usage, you build a report by adopting DeviceActivityReportExtension and DeviceActivityReportScene, querying DeviceActivityData and DeviceActivityResults through a DeviceActivityFilter.

Monitoring Device Activity 2

Register schedules and events with the activity center to be invoked when intervals begin or end or usage thresholds are reached.

  • St
    DeviceActivityCenter
    A class that enables an application's extension to start monitoring scheduled device activity.
  • St
    DeviceActivityName
    The unique name of an activity.

Schedules and Events 2

Describe the recurring intervals and usage thresholds that trigger your monitoring extension.

  • St
    DeviceActivitySchedule
    A calendar-based schedule for when to monitor a device's activity.
  • St
    DeviceActivityEvent
    An event that represents an application, category, or website activity.

Building Activity Reports 2

Adopt these extension and scene protocols to present collected usage data in a report.

  • Pr
    DeviceActivityReportExtension
    An app extension that reports device activity data.
  • Pr
    DeviceActivityReportScene
    Defines a custom device activity report scene.

Querying Usage Data 3

Filter and read the device-activity data and results that back your report.

  • St
    DeviceActivityFilter
    A type that filters the device activity data to include in a report.
  • St
    DeviceActivityData
    Represents the activity of a ``User`` on a particular ``Device``.
  • St
    DeviceActivityResults
    An asynchronous sequence of filtered device activity results.

Classes 2

  • Cl
    DeviceActivityAuthorization
  • Cl
    DeviceActivityMonitor
    The object that monitors scheduled device activity.

Structures 2

  • St
    DeviceActivityReport
    A view that reports the user's application, category, and web domain activity in a privacy-preserving way.
  • St
    DeviceActivityReportBuilder
    A result builder that combines one or more `DeviceActivityReportScene`s into a single scene.

Protocols 1

  • Pr
    DeviceActivityAuthorizing
← App Extensions & System Integration