I'm wanting to be able to update my Apple Watch views if a user has both the Apple Watch app open and the iPhone app open as well. I know there is a WatchKit 1 question asked here, but I want to know if I could do this using WatchConnectivity.
Within my iOS app, I send a message:
if WCSession.isSupported() {
// Set the session to default session singleton
let session = WCSession.defaultSession()
// Fire the message to watch
NSLog("send message")
session.sendMessage(["action": "messageAction"], replyHandler: nil, errorHandler: { (error) -> Void in
// Display alert
NSLog(error.description)
})
}
But I keep getting the error:
Error Domain=WCErrorDomain Code=7007 "WatchConnectivity session on paired device is not reachable." UserInfo={NSLocalizedDescription=WatchConnectivity session on paired device is not reachable.}
To send messages from the iPhone to Apple Watch, is WatchConnectivity
sendMessage
the correct method to use?