0

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
John
  • 8,468
  • 5
  • 36
  • 61
  • Can you clarify what you mean by, "out of reach"? That is, is the phone just locked? Is the phone out of Bluetooth range? – Drewf Nov 19 '15 at 04:06
  • Yes, of course: User infos are not delivered if it was out of Bluetooth range for some time. (Interestingly, if it was out of Bluetooth range for only a few seconds, the data is delivered.) – John Nov 19 '15 at 13:18

1 Answers1

1

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:

jeeeyul
  • 3,727
  • 1
  • 24
  • 37
  • Thank you for the helpful answer. However, how can I automatically initiate the re-send once the iPhone is in BT range of the Apple Watch? – John Dec 28 '15 at 17:31