MatterGoal
MatterGoal

Reputation: 16430

WatchKit event for "devices not paired"?

I want to be sure that when the Watch is not paired with an iPhone the user is warned with the right info. I saw that when I turn off bluetooth some other applications show a full screen red device icon with the name of the app in white, indicating that the device is not paired and that the app needs the pair to work. When I do the same using my App nothing happens, I'm still getting only a little icon next to the time on the to right (or left depending on wrist...) corner, not the full screen icon.

I wonder if is there a specific way to show that state to users or if it should be an automatic function handled by the system that, for some reasons, is not working for me.

Upvotes: 0

Views: 84

Answers (1)

Muneeba
Muneeba

Reputation: 1776

Don't know about the automatic function but using WatchConnectivity framework you can get to know if the paired iPhone is reachable or not . If not you can show an interface controller with proper message to warn user. WCSession has a boolean property reachable whose description is as under.

Discussion

In your WatchKit extension, the value of this property is YES when a matching session is active on the user’s iPhone and the device is within range so that communication may occur. On iOS, the value is YES when the paired Apple Watch is in range and the associated Watch app is running in the foreground. In all other cases, the value is NO.

For more detail check WatchConnectivity Framwork

Upvotes: 2

Related Questions