I am developing a glance view for my Apple WatchOS2 app. I'am currently didn't fully understand the prequisites for a stable WatchConnectivity connection now. I have the strange situation, that in the simulator my ComplicationController could successfully a sendMessage Request. When I try to look at my glance, the sendMessage request failed with:
Error Domain=WCErrorDomain Code=7007
"WatchConnectivity session on paired device is not reachable."
UserInfo={NSLocalizedDescription=WatchConnectivity session
on paired device is not reachable.
I have to admit, that I didn't start my app on the simulator. But why could the ComplicationController communicate and the WatchController won't. And I found no explanation about the error 7007 on the internet.
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
WCSession.defaultSession().sendMessage(["request": "getGlancesImages" ], replyHandler: {
(result) -> Void in
self.processGetGlancesImages(result)
}, errorHandler: { NSLog("WatchGlanceController2. \($0.description)") } )
}
I am currently developing with WatchOS2 Beta 5 and iOS 9 Beta 5. I am fully aware, this is a beta but this is the last beta before release.
Make sure the debugger is attached only to the Watch app and the iPhone app is run directly from the simulator.
So, run the iPhone app to have the latest code, then stop the execution.
Next, run the Watch app and open the iPhone simulator and open the iPhone app.
After both apps started (with the debugger attached only to the Watch app) the sendMessage:replyHandler:errorHandler:
's error callback should not be called and the message should send succesfully.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With