Search code examples
ioswatchkitapple-watchhealthkit

Start an AppleWatch Workout when GPS-tracking is started on iPhone


In order for the users of my fitness app to also get their Heart-rate recorded when they use our app on the iPhone, it would be nice to automatically start our AppleWatch App and retrieve the users Heart-rate from there. Is this somehow possible? I am pretty sure I found an API for that once but can't find it again any more.


Solution

  • For everybody also searching

    It was a method HKHealthStore: startWatchAppWithWorkoutConfiguration:completion:

    See: https://developer.apple.com/documentation/healthkit/hkhealthstore/1648358-startwatchappwithworkoutconfigur