ioswatchkitwatchos-2watchos-3watchos-4

Launching the parent application from the watch app


How can I launch the parent application in background mode on the iPhone directly from the watch?

On Endomondo watch app when you press "start", the parent application will launch itself in the background on the iPhone and start sending data (such as gps location) to the watch. The watch app cannot run without connection with the parent application.

I read about openParentApplication which apparently launched the parent app in the background, but it seemed to only be for watchOS 1 and now we should use Watch Connectivity instead.


Solution

  • Just use WatchConnectivity WCSession->sendMessage

    Calling this method from your WatchKit extension while it is active and running wakes up the corresponding iOS app in the background and makes it reachable.

    offical doc