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 ButtonStyle
to it using the following code snippet.
Property | Description | Code |
---|---|---|
set Background | Sets the background color | .set(background: UIColor) |
set TextFont | Sets the font of the text | .set(textFont: UIFont) |
set TextColor | Sets the color of the text | .set(textColor: UIColor) |
set CornerRadius | Sets the corner radius | .set(cornerRadius: CometChatCornerStyle) |
set BorderColor | Sets the color of the border | .set(borderColor: UIColor) |
set BorderWidth | Sets the width of the border | .set(borderWidth: CGFloat) |
set IconBackground | Sets the background of the icon | .set(iconBackground: UIColor) |
set IconBorder | Sets the border of the icon | .set(iconBorder: CGFloat) |
set IconCornerRadius | Sets the corner radius of the icon | .set(iconCornerRadius: CGFloat) |
set IconTint | Sets the tint of the icon | .set(iconTint: UIColor) |
Property | Description | Code |
---|---|---|
Hide VideoCall | Hides the video call button | .hide(videoCall: Bool) |
Hide VoiceCall | Hides the voice call button | .hide(voiceCall: Bool) |
Controller | Sets the view controller | .set(controller: UIViewController?) |
Group | Sets the Group object for CometChatCallButtons | .set(group: Group) |
IsCenterAligned | Sets the alignment of the buttons | .set(isCenterAligned: Bool) |
User | Sets the User object for CometChatCallButtons | .set(user: User) |
VideoCallIcon | Sets the icon for the video call button | .set(videoCallIcon: UIImage) |
VideoCallIconText | Sets the text for the video call button | .set(videoCallIconText: String) |
VoiceCallIcon | Sets the icon for the voice call button | .set(voiceCallIcon: UIImage) |
VoiceCallIconText | Sets the text for the voice call button | .set(voiceCallIconText: String) |
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.