Interact with SensorKit in your Spezi app.
The Spezi SensorKit module enables apps to integrate with Apple's SensorKit system, such as requesting authorization, setting up background data collection, and fetching collected samples.
import SpeziSensorKit
let sensor = Sensor.heartRate
let devices = try await sensor.fetchDevices()
for device in devices {
let results = try await sensor.fetch(from: device, mostRecentAvailable: .days(2))
for sample in results {
print(sample.timestamp, sample.value, sample.confidence)
}
}For more information, please refer to the API documentation.
The Spezi Template Application provides a great starting point and example using the SpeziSensorKit module.
Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.
This project is licensed under the MIT License. See Licenses for more information.

