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
- An Azure account with an active subscription. Create an account for free.
- A deployed Communication Services resource. Create a Communication Services resource.
- A user access token to enable the call client. Get a user access token.
- Optional: Completion of the quickstart for getting started with the UI Library composites.
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
.
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.