A type the host app creates to launch and manage an app extension.
Create this type from your host app when you want to communicate with an available app
extension. This type creates a new process, and runs the app extension’s startup code in
that process. After startup, establish an XPC connection to the app extension’s process
using the methods of this type. Use that XPC connection to communicate with the app extension.
When creating an instance of this type, you specify which app extension to launch using an
``AppExtensionIdentity`` type. If the app extension is already running, creating the
`AppExtensionProcess` type configures it with the already running process. If the app
extension isn’t yet running, creating this type forks a new process and runs the app
extension’s startup code in it. In both cases, you receive an instance of this structure
only after the app extension is running and ready for you to establish an XPC connection.
Maintain a reference to this structure for as long as you need to communicate with the app
extension. When you no longer need the app extension, call the ``invalidate`` method to release
your app’s reference to the process. If the app extension process exits for any reason, the
system calls the ``AppExtensionProcess/Configuration/onInterruption`` handler you provided
at configuration time.
Members (5)
method · iOS 26.0+
invalidate
TypeScript
invalidate(): void
Swift declaration
func invalidate()
Invalidates the host app’s connection to the app extension process.
Call this method when you finish communicating with an app extension and no longer need it.
If the current object represents the last connection to the app extension, the system
terminates the app extension’s process. After calling this method, don’t try to communicate
with the app extension using XPC. Instead, remove any references to the app extension and
release this `AppExtensionProcess` type.
Finds an existing process for the specified app extension or creates a new one synchronously.
- Parameters:
- configuration: A type that contains the identity of the app extension and additional
configuration details. The initializer copies the information it needs from your configuration
structure and doesn’t maintain a reference to it.
Use this initializer to request a process for the specified app extension and wait for the
results. If a process for the extension already exists, the returned type uses that process.
If no process exists, the system creates one and runs the app extension’s startup code before
returning.
After receiving an instance of this type, use its methods to configure an XPC connection to
the app extension. The system gives the app extension’s process enough runtime for your app
to establish a connection. If you don’t create a connection right away, the system eventually
suspends the app extension’s process. The system resumes the process again if you later try to create
an XPC connection to it.
Finds an existing process for the specified app extension or creates a new one asynchronously.
- Parameters:
- configuration: A type that contains the identity of the app extension and additional
configuration details. The initializer copies the information it needs from your configuration
structure and doesn’t maintain a reference to it.
Use this initializer to request a process for the specified app extension and receive the
results asynchronously. If a process for the extension already exists, the returned type
uses that process. If no process exists, the system creates one and runs the app extension’s
startup code before returning.
After receiving an instance of this type, use its methods to configure an XPC connection to
the app extension. The system gives the app extension’s process enough runtime for your app
to establish a connection. If you don’t create a connection right away, the system eventually
suspends the app extension’s process. The system resumes the process again if you later try to
create an XPC connection to it.
method · iOS 26.0+
makeXPCSession
TypeScript
makeXPCSession(): SDKHandle
Swift declaration
func makeXPCSession() throws -> XPCSession
Connect to the app extension process using an XPC session.
- Returns: The session object your app uses to communicate with the app extension.
Call this method to create a connection between your host app and an app extension using the
XPC framework. You might choose this approach to connect a more secure connection to an app
extension running in a sandboxed process. If the app extension accepts the connection request,
the returned connection object contains the proxy information you need to communicate with it.
If the app extension refuses the request or doesn’t support this connection type, this method
throws an error.
Connect to the app extension process using the XPC types of the Foundation framework.
- Returns: The connection object your app uses to communicate with the app extension.
Call this method to create a connection between your host app and an app extension using the
types of the Foundation framework. If the app extension accepts the connection request, the
returned connection object contains the proxy information you need to communicate with it.
If the app extension refuses the request or doesn’t support this connection type, this
method throws an error.