<!--
{
  "availability" : [
    "iOS: 16.4.0 -",
    "iPadOS: 16.4.0 -",
    "macCatalyst: 16.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SensorKit",
  "identifier" : "/documentation/SensorKit/SRSensor/mediaEvents",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "SensorKit"
    ],
    "preciseIdentifier" : "c:@SRSensorMediaEvents"
  },
  "title" : "mediaEvents"
}
-->

# mediaEvents

A sensor that provides information about interactions with media, such as images and videos, in messaging apps.

```
static let mediaEvents: SRSensor
```

## Discussion

The [`sample`](/documentation/SensorKit/SRFetchResult/sample) type for this sensor is [`SRMediaEvent`](/documentation/SensorKit/SRMediaEvent).

You need to provide a reason to observe the user’s interactions with media by adding the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSSensorKitUsageDetail/SRSensorUsageMediaEvents> dictionary to the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSSensorKitUsageDetail> key in the information property list.

---

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)