kmiklas
kmiklas

Reputation: 13433

Apple Watch: Check pair status?

Is there a class available that will tell me if a watch is paired to a device?

I'm just looking for a simple yes/no check that will tell me if a watch is paired to a device.

Upvotes: 2

Views: 3277

Answers (1)

Seyed Parsa Neshaei
Seyed Parsa Neshaei

Reputation: 3520

You can use the WatchConnectivity (WC) framework to check the connections between iPhone and the paired Apple Watch, including pairing status.

Import WatchConnectivity in your code and then use the following code:

Swift:

if (WCSession.defaultSession().paired){
    // Paired
} else{
    // Not Paired
}

Objective-C:

if([WCSession defaultSession].paired){
    // Paired
} else{
    // Not Paired
}

Use the suitable code for each condition in Obj-C or Swift.

NOTE: WatchConnectivity framework is only available in watchOS 2. You can't get status of the paired Apple Watch in watchOS 1 (the old WatchKit). Make sure ur session is activated. This will return true only after session activated

Upvotes: 6

Related Questions