I have an iOS app that communicates with the paired watch using WatchConnectivity. In most cases, it works without problems, on the simulators and on the devices.
The problem:
During development on the simulators, I get now and then the following communication error when I try to send a direct message from iOS to watchOS using WCSession.default.sendMessage(_:replyHandler:errorHandler:)
:
Error Domain=WCErrorDomain Code=7007
"WatchConnectivity session on paired device is not reachable."
I have read this related post, but it does not apply to my case, because my app does work normally.
My questions:
How can it be that the watch simulator becomes not reachable while the app is running on the iOS simulator?
Does it make sense just to retry sendMessage
after a while?
Is there any workaround?