SensorKit collects sensor and usage data from a person's devices for approved research studies, exposing on-device metrics such as motion, ambient light, and speech analysis. You request access to a sensor with an SRSensorReader, respond to its SRSensorReaderDelegate callbacks, and check the resulting SRAuthorizationStatus before fetching recorded data. Submitting an SRFetchRequest returns historical samples through SRFetchResult, including readings like SRAmbientLightSample, SRAccelerometerSensor data, SRWristTemperature, SRSpeechMetrics, and device usage reports such as SRPhoneUsageReport, SRMessagesUsageReport, and SRKeyboardMetrics. Supporting types including SRDevice, SRAbsoluteTime, SRDeletionRecord, and SRError let you identify the source device, work with sample timestamps, and handle data deletion and failures.
Essentials 6
The core objects for requesting sensor access and fetching recorded research data.
- ClSRSensorReaderAn object that requests authorization for a sensor and reads its recorded research data.
- ClSRReader`SRReader` serves as the primary interface for accessing sensor data from various device sensors.
- PrSRSensorReaderDelegateMethods that respond to authorization changes, fetch progress, and recording state for a sensor reader.
- EnSRAuthorizationStatusiOS 14.0+Constants that indicate whether a person has granted access to a sensor's data.
- StSRSensoriOS 14.0+@typedef SRSensor
- PrSRDataSensor`SRDataSensor` serves as the foundational protocol for all sensor types, providing
Fetching Recorded Samples 4
Types for submitting historical data requests and receiving the resulting samples.
- ClSRFetchRequestiOS 14.0+An object that specifies the device and time range for retrieving recorded sensor samples.
- ClSRFetchResultiOS 14.0+An object that contains a single recorded sample returned from a fetch request.
- StSRFetchResponseA generic container that holds sensor data samples retrieved from SensorKit data streams.
- StSRAbsoluteTimeiOS 14.0+A type that represents a sample's timestamp on the SensorKit absolute time scale.
Identifying the Source 4
Types that identify the device a sample came from and record data deletions.
- ClSRDeviceiOS 14.0+An object that identifies a device contributing data to a research study.
- ClSRSourceDeviceiOS 27.0+An object that identifies the specific device a recorded sample originated from.
- ClSRDeletionRecordiOS 14.0+An object that describes data a person deleted and the time range it covered.
- EnSRDeletionReasoniOS 14.0+Constants that indicate why recorded sensor data was deleted.
Motion Sensors 5
Sensors that report device and body motion, including accelerometer, rotation, pedometer, and odometer data.
- StSRAccelerometerSensorA sensor that records device acceleration over time.
- StSRRotationRateSensorA sensor that records the device's rotation rate over time.
- StSRPedometerDataSensorA sensor that records step counts and related pedometer data.
- StSROdometerSensorA sensor that records distance traveled over time.
- StSRHeadphoneMotionSensorA sensor that records motion data from connected headphones.
Environment Sensors 5
Sensors that capture the ambient conditions around the device.
- StSRAmbientLightSensorA sensor that records ambient light readings around the device.
- ClSRAmbientLightSampleiOS 14.0+An object that contains a single ambient light reading and its measurement.
- StSRAmbientPressureSensorA sensor that records ambient barometric pressure readings.
- StSRVisitsSensorA sensor that records significant location visits over time.
- ClSRVisitiOS 14.0+An object that describes a single significant location visit.
Health and Wrist Sensors 16
Sensors and samples covering heart, temperature, sleep, and wrist-detection signals.
- StSRHeartRateSensorA sensor that records heart rate measurements.
- StSRElectrocardiogramSensorA sensor that records electrocardiogram (ECG) data.
- ClSRElectrocardiogramSessioniOS 17.4+An object that describes a single electrocardiogram recording session.
- ClSRElectrocardiogramDataiOS 17.4+An object that contains the data captured during an electrocardiogram session.
- ClSRElectrocardiogramSampleiOS 17.4+An object that contains a single electrocardiogram measurement.
- StSRPhotoplethysmogramSensorA sensor that records photoplethysmogram (PPG) optical blood-flow data.
- ClSRPhotoplethysmogramSampleiOS 17.4+An object that contains a single photoplethysmogram measurement.
- ClSRPhotoplethysmogramOpticalSampleiOS 17.4+@class SRPhotoplethysmogramOpticalSample
- ClSRPhotoplethysmogramAccelerometerSampleiOS 17.4+An object that contains accelerometer data accompanying a photoplethysmogram sample.
- StSRWristTemperatureSensorA sensor that records wrist temperature measurements.
- ClSRWristTemperatureiOS 17.0+An object that contains a single wrist temperature reading.
- ClSRWristTemperatureSessioniOS 17.0+An object that describes a session of wrist temperature recordings.
- ClSRWristDetectioniOS 14.0+An object that reports whether the device is being worn on the wrist.
- StSROnWristStateSensorA sensor that records whether a worn device is on the wrist.
- StSRSleepSessionsSensorA sensor that records detected sleep sessions.
- ClSRSleepSessioniOS 26.0+An object that describes a single detected sleep session.
Audio and Speech Sensors 9
Sensors that analyze speech, audio levels, and headphone acoustic settings.
- StSRSiriSpeechMetricsSensorA sensor that records on-device speech metrics from Siri interactions.
- StSRTelephonySpeechMetricsSensorA sensor that records on-device speech metrics from telephony calls.
- ClSRSpeechMetricsiOS 17.0+An object that contains on-device measurements derived from a person's speech.
- ClSRSpeechExpressioniOS 17.0+An object that describes expressive characteristics detected in speech.
- ClSRAudioLeveliOS 17.0+An object that describes a measured audio level.
- StSRAcousticSettingsSensorA sensor that records the device's acoustic configuration settings.
- ClSRAcousticSettingsiOS 26.0+An object that describes acoustic settings in effect on the device.
- StSRHeadphoneSettingsSensorA sensor that records connected headphone configuration settings.
- ClSRHeadphoneSettingsiOS 27.0+An object that describes the settings of connected headphones.
Face Sensors 3
Sensors and samples that capture facial expression metrics.
- StSRFaceMetricsSensorA sensor that records facial expression metrics.
- ClSRFaceMetricsiOS 17.0+An object that contains measured facial expression metrics.
- ClSRFaceMetricsExpressioniOS 17.0+An object that describes a single facial expression detected in face metrics.
Device Usage Reports 13
Sensors and reports describing how a person uses their phone, messages, keyboard, and media.
- StSRDeviceUsageSensorA sensor that records general device usage activity.
- ClSRDeviceUsageReportiOS 14.0+An object that summarizes how a person used their device over a period.
- StSRPhoneUsageSensorA sensor that records phone call usage activity.
- ClSRPhoneUsageReportiOS 14.0+An object that summarizes a person's phone call usage over a period.
- StSRMessagesUsageSensorA sensor that records Messages app usage activity.
- ClSRMessagesUsageReportiOS 14.0+An object that summarizes a person's Messages usage over a period.
- StSRKeyboardMetricsSensorA sensor that records on-device keyboard typing metrics.
- ClSRKeyboardMetricsiOS 14.0+An object that contains measured keyboard typing metrics.
- StSRMediaEventsSensorA sensor that records media interaction events.
- ClSRMediaEventiOS 16.4+An object that describes a single media interaction event.
- EnSRMediaEventTypeiOS 16.4+Constants that classify the kind of a recorded media event.
- ClSRTextInputSessioniOS 15.0+An object that describes a session of text input captured for keyboard metrics.
- ClSRSupplementalCategoryiOS 16.4+@class SRSupplementalCategory
Errors 1
The error type that describes SensorKit access and fetch failures.
- StSRErroriOS 14.0+A structure that describes errors raised while requesting access to or fetching SensorKit data.