On September 25th, 2024, we released v2 of the Apps SDK. To learn what’s new and how to upgrade, see Migration FAQ and Migration guide.

appProcess.requestClose

API reference for the appProcess.requestClose method.
This version of the API is in beta. Beta APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.

Requests the termination of the specified app process.

Once called, this method:

  1. Transitions the state of the process to "closing".
  2. Invokes all registered setOnDispose callbacks.
  3. Waits for the process to finish closing.
  4. Transitions the state of the process to "closed".

Each time the state changes, all of the registerOnStateChange callbacks are called..

Parameters

targetAppProcessId
REQUIRED

The ID of an app process.

paramsT
REQUIRED

Parameters to pass to the setOnDispose callback. Any kind of structured data can be passed via this property.

Properties of params
reasonCloseReason
REQUIRED

The reason the app process is closing.

The available options include:

  • "completed"
  • "aborted"

Returns

Promise<void>