Problem:

I tried to use "transferUserInfo" to send information from my Watch app to the main iPhone app. This works when the iPhone is available.

If the iPhone is not available, from my understanding, the messages should be queued and delivered in order when the iPhone becomes available. But it does not work when the iPhone has not been available for some time (then "didReceiveUserInfo" is not called and the messages are lost).

What can I do to ensure that all messages I sent to the iPhone while it is not available are eventually delivered and not lost?

Is this an iOS/watchOS bug, is it a possible problem in my implementation, or is this an intended behavior? Have others experienced the same problem?

Devices and OS

  • iPhone 6s with iOS 9.1
  • Apple Watch with watchOS 2.0.1
1

There are 1 best solutions below

1
On BEST ANSWER

Your guessed behavior is right, transferUserInfo: should have to enqueue when it's not connected.

However, the disconnection or error can be occurred when transferring also. In this case, watch OS seems to not re-transfer.

In WCSessionDelegate, there is a callback -session:didFinishUserInfoTransfer:error:. This callback is invoked for both of case success or error.

With this, You can get error condition, You can re-send using transferUserInfo: