Hi together,
my watch app requests the iPhone continously for generating a geo specific UIImage and transfers it back by "sendMessageData". To avoiding multiple parallel requests I tried two schemes:
1. sendMessageData/didReceiveMessageData on both sides: In my extension I start a request when session state changed to reachable. Then I receive this request on the iPhone via "didReceiveMessageData". I generate the image and send it back to the watch via "sendMessageData". On the extension I have also a "didReceiveMessageData" implemented. After processing the UIImage I start my next request via "sendMessageData".
2. using replyHandler: In my extension I start a request when session state changed to reachable. In the "sendMessageData" on watch side I have implemented a replyHandler which processes the reply from the iPhone and starts the next request. On the iPhone I have only implemented "didReceiveMessageData" where I analyse the request, generates the UIImage and send it back as a replyHandler.
The problem is for both implementations the same:
When the watch goes in supsension mode (tilting hand -> display goes off) and I immediately tab on the watch, the request ends up in nirvana. In my analyzis it seems that the watch sends the request but didn't get any answer. However there is no error in the error handler on the "sendMessageData" on the watch.
But if I wait a few seconds before I tab the screen, the app comes back from suspension, sends the request and gets an answer.
Bye the way, on the simulator I don't have this crazy effect.
Any ideas how to solve that?
Walter