<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSExtensionContext/open(_:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSExtensionContext(im)openURL:completionHandler:"
  },
  "title" : "open(_:completionHandler:)"
}
-->

# open(_:completionHandler:)

Asks the system to open a URL on behalf of the currently running app extension.

```
func open(_ URL: URL, completionHandler: (@Sendable (Bool) -> Void)? = nil)
```

## Parameters

`URL`

The URL to open.

`completionHandler`

A block/closure to be called when the URL has opened. The closure takes a single boolean parameter indicating whether the operation was successful.

## Discussion

Each extension point determines whether to support this method, or under which conditions to support this method. In iOS,  the Today and iMessage app extension points support this method. An iMessage app extension can use this method only to open its parent app, and only if the parent app is shown on the iOS home screen.

> Important:
> You can use this method in a Today widget to open the widget’s containing app. If you use this method to open other apps from your Today widget, your App Store submission may require additional review. To learn more, see [App Store Review Guidelines](http://developer.apple.com/appstore/resources/approval/guidelines.html) and [iOS Human Interface Guidelines](https://developer.apple.com/ios/human-interface-guidelines/).

---

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)