<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WatchConnectivity",
  "identifier" : "/documentation/WatchConnectivity/WCSession/updateApplicationContext(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Watch Connectivity"
    ],
    "preciseIdentifier" : "c:objc(cs)WCSession(im)updateApplicationContext:error:"
  },
  "title" : "updateApplicationContext(_:)"
}
-->

# updateApplicationContext(_:)

Sends a dictionary of values that a paired and active device can use to synchronize its state.

```
func updateApplicationContext(_ applicationContext: [String : Any]) throws
```

## Parameters

`applicationContext`

A dictionary of property list values. You define the meaning of the dictionary contents. This parameter must not be `nil`.

## Discussion

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(_:didReceiveApplicationContext:)`](/documentation/WatchConnectivity/WCSessionDelegate/session(_:didReceiveApplicationContext:)) method of its delegate. A counterpart can also retrieve the data from the [`receivedApplicationContext`](/documentation/WatchConnectivity/WCSession/receivedApplicationContext) 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 [`activationState`](/documentation/WatchConnectivity/WCSession/activationState) property is set to  [`WCSessionActivationState.activated`](/documentation/WatchConnectivity/WCSessionActivationState/activated). Calling this method for an inactive or deactivated session is a programmer error.

> Handling Errors in Swift:
> In Swift, this method returns `Void` and is marked with the `throws` keyword to indicate that it throws an error in cases of failure.
> 
> You call this method in a `try` expression and handle any errors in the `catch` clauses of a `do` statement, as described in [Error Handling](https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html) in [The Swift Programming Language](https://docs.swift.org/swift-book/) and `About Imported Cocoa Error Parameters`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)