Contents

unregisterForLaunch(onQuickSwitchStateEvents:)

Removes the calling app’s registration for background launch on quick switch state changes.

Declaration

func unregisterForLaunch(onQuickSwitchStateEvents completionHandler: @escaping  @Sendable ((any Error)?) -> Void)
func unregisterForLaunchOnQuickSwitchStateEvents() 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

Call this method when you want to de-register the current device so it no longer receives quick switch event notifications when your app isn’t running.

After this call succeeds, the system no longer launches the app in the background when the device’s QuickSwitch state transitions. The framework calls the completion handler with a non-nil error if the app was not previously registered or if the the framework couldn’t complete the request.

See Also

Registering and unregistering for quick switch events