iosswiftwatchkitapple-watchwatchos-2

How to programmatically open Apple Watch companion app from iOS app


I would like to give a hint to the user, that my iOS app supports the Apple Watch.

So I would like to link/open the Apple Watch companion app from within my iOS app, very much similar to opening the Settings App using ([[UIApplication sharedApplication] openURL: [NSURL URLWithString:UIApplicationOpenSettingsURLString]];)

This shall enable the user to directly navigate to the Watch companion app to setup my app for the watch.

I could not find any URL which would open the companion app in general or specific to a section of the companion app.

If direct linking is not supported, I am also interested in alternative approaches for this use case.

Thanks in advance!

EDIT: I checked the WatchKitSettings Info.plist file in the simulator to see if it registers any URL schema, but it does not.


Solution

  • I guess it's not possible to programmatically launch the watch companion app from iOS. The opposite way would be possible: to launch the iOS app in the background upon receiving a message from the watch. See WWDC talk Introducing Watch Connectivity.

    You could check WCSession.defaultSession().watchAppInstalled and ask the user to launch the app if it is true.