Sends a dictionary of values that a paired and active device can use to synchronize its state.
- iOS 9.0+
- Mac Catalyst 13.0+Beta
- watchOS 2.0+
A dictionary of property list values. You define the meaning of the dictionary contents. This parameter must not be
On input, a pointer to an error object. On output, the pointer is set to an error object if a problem occurred. You may specify
nilif you do not care about error information.
An error indicating the reason why the update could not be sent to the counterpart. Calls to this method can fail when the dictionary does not contain property-list data types.
Use this method to transfer a dictionary of data items to the counterpart app. The system sends context data when the opportunity arises, with the goal of having the data ready to use by the time the counterpart wakes up. The counterpart’s session delivers the data to the
session(_: method of its delegate. A counterpart can also retrieve the data from the
received property of its session.
This method replaces the previous dictionary that was set, so you should use this method to communicate state changes or to deliver data that is updated frequently anyway. For example, this method is well suited for updating your app’s glance.
You may call this method when the counterpart is not currently reachable.
This method can only be called while the session is active—that is, the
activation property is set to
WCSession. Calling this method for an inactive or deactivated session is a programmer error.