Phyber
Phyber

Reputation: 1368

WatchOS - complication update from iOS

Is there a way how to update watch complication from iOS app? I've found some solutions but nothing works for me. I need to change the text in the complication to the text inside iOS app whenever I touch my button inside the iOS app. Any solution?

Upvotes: 0

Views: 458

Answers (1)

abjurato
abjurato

Reputation: 1469

Use the Watch Connectivity framework to send the update to the watch by calling your WCSession object’s transferCurrentComplicationUserInfo: method. This method sends a high priority message to your WatchKit extension, waking it as needed to deliver the data. As soon as the watch receives the data, it calls your session delegate’s session:didReceiveUserInfo: method. In this method, update your complication data using the provided user info dictionary, and then call your data source’s reloadTimelineForComplication: or extendTimelineForComplication: method to update your timeline.

From here More details in this 2016 WWDC session.

But pay attention that number of such pushes is limited to 50 in watchOS3.

Upvotes: 3

Related Questions