What problem does it solve?
Enables approved research apps to collect, manage, and fetch high-fidelity sensor data from iPhone and Apple Watch while enforcing platform entitlements, user consent, and data-holding policies to avoid incorrect or unauthorized data access.
Core Features & Use Cases
- Entitlement & Provisioning Guidance: Shows how to add com.apple.developer.sensorkit.reader.allow, configure manual provisioning, and list only required sensors.
- Authorization & Privacy: Explains per-sensor Info.plist keys, the Research Sensor & Usage Data sheet, and how to request and respond to authorization status changes.
- Recording, Fetching & Device Management: Demonstrates SRSensorReader usage for start/stop recording, building SRFetchRequest ranges that respect the 24-hour hold, fetching SRDevice lists, and processing SRFetchResult samples (ambient light, accelerometer, keyboard metrics, ECG/PPG, device usage, visits, media events, etc.).
- Robust Patterns & Testing: Includes delegate wiring, multi-sensor manager patterns, sample processing advice, error handling for SRError codes, and device/testing constraints (no simulator, Apple Watch/TrueDepth requirements).
- Use Case: Implement a research study that records ambient light, wrist temperature, and keyboard metrics, requests user consent, and periodically fetches prior-day samples for analysis.
Quick Start
Request SensorKit authorization for ambient light and accelerometer, start recording, and fetch two days of historical data for the current device.