<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeviceActivity",
  "identifier" : "/documentation/DeviceActivity/DeviceActivityReport",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Device Activity",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:23_DeviceActivity_SwiftUI0aB6ReportV"
  },
  "title" : "DeviceActivityReport"
}
-->

# DeviceActivityReport

A view that reports the user’s application, category, and web domain activity in a privacy-preserving way.

```
@MainActor @preconcurrency struct DeviceActivityReport
```

## Overview

When you create a report, the system asks your app’s device activity report extension to provide a
<doc://com.apple.documentation/documentation/SwiftUI/View> representing the user’s device activity. To protect the
user’s privacy, your extension runs in a sandbox. This sandbox prevents your extension from making network requests or moving
sensitive content outside the extension’s address space. The extension point identifier for all device activity report extensions is
`com.apple.deviceactivityui.report-extension`. You can configure a report with a custom context and filter, and
then display the report like any SwiftUI view.

```
struct ExampleView: View {
    let selectedApps: Set<ApplicationToken>
    let selectedCategories: Set<ActivityCategoryToken>
    let selectedWebDomains: Set<WebDomainToken>

    @State private var context: DeviceActivityReport.Context = .barGraph
    @State private var filter = DeviceActivityFilter(
        segment: .daily(
            during: Calendar.current.dateInterval(
               of: .weekOfYear, for: .now
            )!
        ),
        users: .children,
        devices: .init([.iPhone, .iPad]),
        applications: selectedApps,
        categories: selectedCategories,
        webDomains: selectedWebDomains
    )

    public var body: some View {
        VStack {
            DeviceActivityReport(context, filter: filter)

            // A picker used to change the report's context.
            Picker(selection: $context, label: Text("Context: ")) {
                Text("Bar Graph")
                    .tag(DeviceActivityReport.Context.barGraph)
                Text("Pie Chart")
                     .tag(DeviceActivityReport.Context.pieChart)
            }

            // A picker used to change the filter's segment interval.
            Picker(
                selection: $filter.segmentInterval,
                 label: Text("Segment Interval: ")
            ) {
                Text("Hourly")
                    .tag(DeviceActivityFilter.SegmentInterval.hourly())
                Text("Daily")
                    .tag(DeviceActivityFilter.SegmentInterval.daily(
                        during: Calendar.current.dateInterval(
                             of: .weekOfYear, for: .now
                        )!
                    ))
                Text("Weekly")
                    .tag(DeviceActivityFilter.SegmentInterval.weekly(
                        during: Calendar.current.dateInterval(
                            of: .month, for: .now
                        )!
                    ))
            }
            // ...
        }
    }
}
```

The system will only provide your extension with device activity data if the user has authorized your app for family
controls on their device or on the device(s) of children in their iCloud family. See
<doc://com.apple.documentation/documentation/FamilyControls/AuthorizationCenter>
for more details.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)