---
title: "registerForLaunch(onQuickSwitchStateEvents:)"
framework: coretelephony
role: symbol
role_heading: Instance Method
path: "coretelephony/ctquickswitchmanager/registerforlaunch(onquickswitchstateevents:)"
---

# registerForLaunch(onQuickSwitchStateEvents:)

Registers the calling app for background launch whenever the device’s quick switch state changes.

## Declaration

```swift
func registerForLaunch(onQuickSwitchStateEvents completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func registerForLaunchOnQuickSwitchStateEvents() async throws
```

## Parameters

- `completionHandler`: A completion handler the framework calls after processing the request. The parameter passed to the completion handler indicates whether the request succeeded, failed, or ended in an unknown state.

## Discussion

Discussion important: This only applies to apps that someone has set to be the default messaging or default calling app. For more information on becoming the default messaging app, see Preparing your app to be the default messaging app. For more info on becoming the default calling app, see Preparing your app to be the default calling app. Call this method when you want to register the current device to receive quick switch event notifications when your app isn’t running. If an app successfully registers to receive these events, the system allocates runtime to the app to process state changes even if it’s not currently running at the time of a stage change. Registration persists until the app explicitly removes itself with unregisterForLaunch(onQuickSwitchStateEvents:). The framework calls the completion handler with a non-nil error if the app is not eligible to register.

## See Also

### Registering and unregistering for quick switch events

- [unregisterForLaunch(onQuickSwitchStateEvents:)](coretelephony/ctquickswitchmanager/unregisterforlaunch(onquickswitchstateevents:).md)
