CometChatCallButtons
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.
CometChatCallButtons
can be used inside another widget or can be launched to a new screen by adding the following code snippet into the XML layout file.
CometChatCallButtons
within the XML code or in your activity or fragment then you’ll need to extract them and set them on the User object using the appropriate method.
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.
setOnError
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 are as follows.
Event | Description |
---|---|
ccCallAccepted | Triggers when the outgoing call is accepted. |
ccCallRejected | Triggers when the outgoing call is rejected. |
CometChatCallEvents
CometChatCallEvents
Property | Description | Code |
---|---|---|
setUser | Used to set User object to the call button | .setUser(User user) |
setGroup | Used to set Group object to the call button | .setGroup(group) |
setVideoCallButtonVisibility | Used to hide video call button | .setVideoCallButtonVisibility(View.GONE) |
setVoiceCallButtonVisibility | Used to hide voice call button | .setVoiceCallButtonVisibility(View.GONE) |
setCallSettingsBuilder | Sets the call settings builder callback function. This callback is responsible for configuring the call settings based on the user, group, and call type (audio/video). | .setCallSettingsBuilder(Function3<User, Group, Boolean, CometChatCalls.CallSettingsBuilder> callSettingsBuilder) |
setOutgoingCallConfiguration | Sets the configurations for outgoing call component. | .setOutgoingCallConfiguration(new OutgoingCallConfiguration) |
CometChatCallButtons
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.