Call Button
is a Component provides users with the ability to make calls, access call-related functionalities, and control call settings. Clicking this button typically triggers the call to be placed to the desired recipient.
CometChatCallButton
is a custom view, it offers flexibility in integration. It can be easily added to any view or embedded within other components, enhancing user interactions and providing seamless access to call functionalities.
setOnVoiceCallClick
action is usually invoked when a voice call is initiated, executing predefined actions. However, by utilizing the provided code snippet, you can effortlessly tailor or override this default behavior to suit your unique requirements.
setOnVideoCallClick
action is typically triggered when a video call is initiated, executing default actions. However, with the provided code snippet, you have the flexibility to easily customize or override this default behavior according to your specific preferences or requirements.
On Error
and improve error handling.
Component
. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
Events emitted by the Call buttons component is as follows.
Event | Description |
---|---|
onOutgoingCallAccepted | Triggers when the outgoing call is accepted. |
onOutgoingCallRejected | Triggers when the outgoing call is rejected. |
CallButtons
Component by applying the CallButtonStyle
to it using the following code snippet.
Global level styling
Property | Description | Code |
---|---|---|
Video Call Icon Tint | Tint color for the video call icon. | CometChatCallButtons.style.videoCallIconTint = CometChatTheme.iconColorPrimary |
Video Call Text Font | Font for the video call button text. | CometChatCallButtons.style.videoCallTextFont = CometChatTypography.Body.regular |
Video Call Text Color | Color for the video call button text. | CometChatCallButtons.style.videoCallTextColor = CometChatTheme.iconColorPrimary |
Video Call Button Background | Background color for the video call button. | CometChatCallButtons.style.videoCallButtonBackground = .clear |
Video Call Corner Radius | Corner radius for the video call button. | CometChatCallButtons.style.videoCallButtonCornerRadius = CometChatCornerStyle? |
Video Call Border Width | Border width for the video call button. | CometChatCallButtons.style.videoCallButtonBorder = 0 |
Video Call Border Color | Border color for the video call button. | CometChatCallButtons.style.videoCallButtonBorderColor = .clear |
Video Call Icon | Icon for the video call button. | CometChatCallButtons.style.videoCallIcon = UIImage(systemName: "video") |
Audio Call Icon Tint | Tint color for the audio call icon. | CometChatCallButtons.style.audioCallIconTint = CometChatTheme.iconColorPrimary |
Audio Call Text Font | Font for the audio call button text. | CometChatCallButtons.style.audioCallTextFont = CometChatTypography.Body.regular |
Audio Call Text Color | Color for the audio call button text. | CometChatCallButtons.style.audioCallTextColor = CometChatTheme.iconColorPrimary |
Audio Call Button Background | Background color for the audio call button. | CometChatCallButtons.style.audioCallButtonBackground = .clear |
Audio Call Corner Radius | Corner radius for the audio call button. | CometChatCallButtons.style.audioCallButtonCornerRadius = CometChatCornerStyle? |
Audio Call Border Width | Border width for the audio call button. | CometChatCallButtons.style.audioCallButtonBorder = 0 |
Audio Call Border Color | Border color for the audio call button. | CometChatCallButtons.style.audioCallButtonBorderColor = .clear |
Audio Call Icon | Icon for the audio call button. | CometChatCallButtons.style.audioCallIcon = UIImage(systemName: "phone") |
Property | Description | Code |
---|---|---|
hideVideoCallButton | Hides the video call button | hideVoiceCallButton = true |
hideVoiceCallButton | Hides the voice call button | hideVoiceCallButton = true |
set(user:User) | Sets the User object for CometChatCallButtons. | .set(user:User) |
set(group:Group) | Sets the Group object for CometChatCallButtons. | .set(group:Group) |
set(outgoingCallConfiguration:) | Sets the configuration for outgoing calls. | setOutgoingCallConfiguration(config) |
set(customSoundForCalls:) | Sets a custom sound for incoming and outgoing calls. | set(customSoundForCalls: URL) |
set(callSettingBuilder:) | Function to build call settings based on call type and participants. | .set(callSettingBuilder { callType, participants in ... }) |
Call Buttons
component does not provide additional functionalities beyond this level of customization.
Configurations
expose properties that are available in its individual components.OutgoingCallConfiguration
. You can accomplish this by employing the OutgoingCallConfiguration
as demonstrated below:
OutgoingCallConfiguration
can be found under Outgoing Call. Properties marked with the 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Outgoing Call subcomponent and, in addition, you only want to disable soundForCalls.
You can modify the style using the OutgoingCallStyle
property, disable sound for calls using .disable(soundForCalls: bool)
property.
CallButtons
is properly configured, passing the controller is mandatory.