I am working on a application which needs accelerometer, gyroscope & pedometer data & also the heart rate. I am transferring this data from iwatch to iPhone then from iPhone I need to sync this data via MQTT protocol. Now my problem is that, once the iwatch window goes disable my application terminated. I am using core motion and live workout session.
Can anyone help me on how can I keep the iwatch app active or transfer the above data from inactive mode ?
2
Answers
Here is my solution that can help you:
Ref: https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/running_workout_sessions
HKWorkoutSession
andCoreMotion
listenerAn addition to good answer of Neklas, should open capability of Healhkit and add permission of healthkit to info plist of watchos project like below images. Otherwise, you may encounter an error.