Skip to main content
The CometChatOutgoingCall component is a visual representation of a user-initiated call, whether voice or video. It serves as an interface for managing outgoing calls, providing users with essential options to control the call experience.
CometChatOutgoingCall showing outgoing call interface with recipient avatar, name, and cancel button

Usage

Integration

CometChatOutgoingCall is a custom view controller that offers versatility in its integration. It can be seamlessly launched via button clicks or any user-triggered action, enhancing the overall user experience and facilitating smoother interactions within the application.
If you are already using a navigation controller, you can use the pushViewController function instead of presenting the view controller.

Actions

Actions dictate how a component functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the component to fit your specific needs.

1. SetOnCancelClick

The setOnCancelClick action is typically triggered when the call is canceled, carrying out default actions. You can customize or override this default behavior using the following code snippet:

2. OnError

You can customize error handling behavior by using the provided code snippet to override the onError callback:

Filters

Filters allow you to customize the data displayed in a list within a Component. You can filter the list based on your specific criteria for a more customized experience. Filters can be applied using RequestBuilders of the Chat SDK. The OutgoingCall component does not have any exposed filters.

Events

Events are emitted by a Component. By using events, you can extend existing functionality. Being global events, they can be applied in multiple locations and can be added or removed as needed.
Emitting Call Events

Customization

To fit your app’s design requirements, you can customize the appearance of the component. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.

Style

Using Style, you can customize the look and feel of the component in your app. These parameters typically control elements such as the color, size, shape, and fonts used within the component.

1. OutgoingCall Style

You can customize the appearance of the OutgoingCall Component by applying the OutgoingCallStyle to it. Global level styling
Instance level styling
CometChatOutgoingCall with custom styling showing custom fonts and rounded decline button

OutgoingCallStyle Properties


Functionality

These are small functional customizations that allow you to fine-tune the overall experience of the component.

Advanced

For advanced-level customization, you can set custom views to the component. This lets you tailor each aspect of the component to fit your exact needs and application aesthetics. You can create and define your own views, layouts, and UI elements and then incorporate those into the component.

SetAvatarView

With this function, you can assign a custom view to the avatar of the OutgoingCall Component.
Demonstration
CometChatOutgoingCall with custom avatar view showing profile image with star badge overlay
You can create a CustomAvatarView as a custom UIView:

SetCancelView

You can modify the cancel call view of the Outgoing call component using the property below:
Demonstration
CometChatOutgoingCall with custom cancel view showing red End Call button with phone icon
You can create a CustomCancelView as a custom UIView:

SetTitleView

You can customize the title view of the outgoing call component using the property below:
Demonstration
CometChatOutgoingCall with custom title view showing call initiator and receiver names
You can create a CustomTitleView as a custom UIView:

SetSubtitleView

You can modify the subtitle view of the outgoing call component using the property below:
Demonstration
CometChatOutgoingCall with custom subtitle view showing phone icon and Calling status text
You can create a CustomSubtitleView as a custom UIView:

Props

All props are optional unless noted.

call

The outgoing call object to display.

disableSoundForCalls

Disables the outgoing call ringtone.

customSoundForCalls

Custom sound file URL for outgoing calls.

avatarStyle

Customizes the appearance of the recipient’s avatar.

Events

Events emitted by the Outgoing Call component:

View Slots

leadingView

You can customize the leading view of an outgoing call component using the property below.

trailingView

You can customize the trailing view of an outgoing call component using the property below.

Common Patterns

Initiate Call and Present Outgoing Screen

Start a call and show the outgoing call interface:

Handle Call Acceptance and Transition to Ongoing Call

Navigate to ongoing call when the recipient accepts:

Custom Cancel Action with Confirmation

Show confirmation before canceling an outgoing call:

Incoming Call

Display incoming call interface

Ongoing Call

Display active call interface

Call Logs

Display call history