Disable the call confirmation prompt in an application

The Azure Communication Services UI Library offers the option to disable the left call confirmation prompt, by default the UI Library show a prompt asking the user to confirm the end of the call; one common customization might involve streamlining the user experience, such as disabling the left call confirmation prompt when a user decide to end the call. This adjustment can make the call termination process quicker and reduce friction for users who are accustomed to instant actions.

In this article, you learn how to disable the left call confirmation prompt.

Prerequisites

Set up the feature

Disabling Leave Call Confirmation

To disable the left call confirmation prompt when clicking the end call button, utilize CallCompositeCallScreenOptions to configure CallCompositeCallScreenControlBarOptions. Set CallCompositeLeaveCallConfirmationMode.ALWAYS_DISABLED as the constructor parameter. By default, the UI library employs CallCompositeLeaveCallConfirmationMode.ALWAYS_ENABLED.

val callScreenOptions = CallCompositeCallScreenOptions(
            CallCompositeCallScreenControlBarOptions()
                .setLeaveCallConfirmation(CallCompositeLeaveCallConfirmationMode.ALWAYS_DISABLED)
        )

val callComposite: CallComposite =
            CallCompositeBuilder()
            .callScreenOptions(callScreenOptions)
            .build()

Disabling Leave Call Confirmation

To disable the left call confirmation prompt triggered by clicking the end call button, utilize the CallScreenOptions class to configure the CallScreenControlBarOptions. Set the LeaveCallConfirmationMode parameter to alwaysDisabled. By default, the UI library enables LeaveCallConfirmationMode as alwaysEnabled.

let callCompositeOptions = CallCompositeOptions(
    callScreenOptions: CallScreenOptions(
        controlBarOptions: CallScreenControlBarOptions(
            leaveCallConfirmationMode: LeaveCallConfirmationMode.alwaysDisabled
        )
    )
)

let callComposite = CallComposite(withOptions: callCompositeOptions)

This setup ensures that the left call confirmation prompt is disabled when the end call button is clicked.

Next steps