How to tell from phone if a watch is paired?

There was some discussion on this earlier, but all the posts basically summed to "once the watch app has run your phone app will know". That doesn't help my use case: I would like to let the user of the phone app know (with an alert) that they can now access the app from their watch. I specifically want to alert the phone app user who has never opened the watch app as they may not even realize that there is a corresponding watch app already on their watch.


WKInterfaceDevice.currentDevice().screenBounds.size returns (0.0, 0.0) on the phone simulator if External Displays is set to Disabled, but actual devices (the ones I've tested) return (156.0, 195.0) even though no watch is paired or has ever been paired, so that cannot be used for this purpose.


Has anyone found a reliable method of discovering whether a watch is paired without the watch app ever haveing been run? I would even settle for "has ever been paired". I just don't want to alert the 99% of users who do not have a watch.

Answered by iang in 17152022

If you are using watchOS 2 I believe you could use the WatchConnectivity framework. Specifically:


WCSession* session = [WCSession defaultSession];
if (session.isPaired) { ... }

Documentation states isPaired -> /* Check if iOS device is paired to a watch */


There is also:


/ Check if the user has the Watch app installed */
@property (nonatomic, readonly, getter=isWatchAppInstalled) BOOL watchAppInstalled __WATCHOS_UNAVAILABLE;

There is no way to determine this UNTIL, the watch app has actually been run. When that

happens, your watch app can set a flag to indicate that it has been run and you can check

that on each launch on the iPhone app. But, you cannot determine the availability of the

watch with the current frameworks. This may be possible in Watch OS 2 but not in the current

version.


By the way, your bounds checking on the simulator serves very little purpose. You'd need to

run on an actual device for that to be of any use and even then with the current APIs there

isn't a lot of point in doing so.

I understand all that. I'm a) pointing out that the behavior of the simulator (zero bounds with no paired watch) makes more sense and it would be useful if the actual device behaved in the same manner, and b) asking for any ideas on how to discover whether a watch is paired BEFORE the corresponding watch app is run for the first time. I thought my use case made that clear.

Sadly, that's the point. There is no way to know. In fact, based on recent behavior of my own Apple Watch

I'd say such detection will never be possible. What behavior, oh, just the phone and watch both forgetting

they are paired and how to work together... Only a factory restore fixed that issue. Which meant setting up

the watch all over again and restoring from backup, then re-entering pass codes and Apple Pay settings.

Accepted Answer

If you are using watchOS 2 I believe you could use the WatchConnectivity framework. Specifically:


WCSession* session = [WCSession defaultSession];
if (session.isPaired) { ... }

Documentation states isPaired -> /* Check if iOS device is paired to a watch */


There is also:


/ Check if the user has the Watch app installed */
@property (nonatomic, readonly, getter=isWatchAppInstalled) BOOL watchAppInstalled __WATCHOS_UNAVAILABLE;

Just saw this on WWDC video 713. Exactly what is needed for this purpose.

How to tell from phone if a watch is paired?
 
 
Q