0

So, I am trying to use the oppertunity when my Watchkit complication calls requestUpdateDidBegin() to use sendMessage() to wake my iOS app and cause it to calculate complication data and use transferCurrentComplicationUserInfo() to update the complication. I call sendMessage() from the extension delegate. I am experiencing mixed luck with this actually reaching the iOS app. Even with my iPhone next to the watch the performance varies. One time I built my app to my phone and it successfully delivered over 30 updates to my complication through sendMessage() and transferCurrentComplicationUserInfo(), over the course of two days. I then uninstalled the app from the watch using the watch app, and then reinstalled it from the watch app (So absolutly no code or build changes) and it stopped working! I suspect there is clearly some bugs and unreliability with calling sendMessage(). Is anyone else finding this, is there any workarounds? How can I wake my iPhone app from when the complication controller calls requestUpdateDidBegin()?

Simon
  • 304
  • 2
  • 17

1 Answers1

0

I don't believe there is any guarantee you can wake the iPhone from the watch. If you need to update with data from the phone, you are better to schedule the updates on the iPhone app and then push the updated data from the phone. You'll probably need to enable a background mode on the iPhone app for this to work (location services, background data transfer, depending on your data type.)

(As posted here https://forums.developer.apple.com/thread/26934)

Cobra
  • 369
  • 1
  • 6
  • But theres no way to wake the phone from background for what I want other than fetch, and fetch is completely unreliable. I struggle to understand why I can't wake my app reliable from my complication controller, but I can wake it reliably from my interface or glance controller. – Simon Nov 25 '15 at 19:05
  • You'll find this true once you do more testing. I'm sorry you don't like the answer. Why do you not want to use a local notification to wake your iPhone app for update? – Cobra Nov 27 '15 at 15:20
  • And I realise my previous comment was a it sarcastic, apologies. Local notifications require user interaction in order for the app to execute code. Or at least that what I know. – Simon Nov 27 '15 at 23:13