---
title: "accept(connection:)"
framework: extensionfoundation
role: symbol
role_heading: Instance Method
path: "extensionfoundation/appextensionconfiguration/accept(connection:)"
---

# accept(connection:)

Returns a Boolean value that indicates whether you accept an incoming connection request from the host app.

## Declaration

```swift
nonisolated func accept(connection: NSXPCConnection) -> Bool
```

## Parameters

- `connection`: A connection object you can use to communicate with the host app.

## Mentioned in

Building an app extension to support a host app

## Return Value

Return Value true if you accept the connection to the host app, or false if you don’t.

## Discussion

Discussion Implement this method in your custom type and use it to establish communication between your app extension and the host app that made the request. To accept a connection request, set the connection’s exportedObject property to an object in your app extension that implements a protocol or type from the host’s SDK. Similarly, put the type information in the exportedInterface property. You can also retrieve other relevant properties of the connection object, such as the remote connection details, and use them to set up your app extension. When you’re ready to start communicating with the host, call the connection’s resume() method and then return true from this method.
