Incoming call
is a Component that serves as a visual representation when the user receives an incoming call, such as a voice call or video call, providing options to answer or decline the call.
CometChatIncomingCall
being a custom view controller, 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.
pushViewController
function instead of presenting the view controller.setOnAcceptClick
action is typically triggered when the user clicks on the accept button, initiating a predefined action. However, by implementing the following code snippet, you can easily customize or override this default behavior to suit your specific requirements.
setOnCancelClick
action is typically triggered when the user clicks on the reject button, initiating a predefined action. However, by implementing the following code snippet, you can easily customize or override this default behavior to suit your specific 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 Incoming Call component is as follows.
Event | Description |
---|---|
onIncomingCallAccepted | Triggers when the logged-in user accepts the incoming call. |
onIncomingCallRejected | This event is triggered when the logged-in user rejects the incoming call. |
onCallEnded | This event is triggered when the initiated call successfully ends. |
IncomingCall
Component by applying the IncomingCallStyle
to it using the following code snippet.
Property | Description | Code |
---|---|---|
set Background | Sets the background color for IncomingCall | .set(background: UIColor) |
set CornerRadius | Sets the corner radius for IncomingCall | .set(cornerRadius: CometChatCornerStyle) |
set BorderWidth | Sets the border width for IncomingCall | .set(borderWidth: CGFloat) |
set BorderColor | Sets the border color for IncomingCall | .set(borderColor: UIColor) |
set TitleColor | Sets the title color for IncomingCall | .set(titleColor: UIColor) |
set TitleFont | Sets the title font for IncomingCall | .set(titleFont: UIFont) |
set SubtitleColor | Sets the subtitle color for IncomingCall | .set(subtitleColor: UIColor) |
set SubtitleFont | Sets the subtitle font for IncomingCall | .set(subtitleFont: UIFont) |
Avatar
component in the IncomingCall Component, you can use the following code snippet. For further insights on Avatar
Styles refer
cometChatIncomingCall
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.Property | Description | Code |
---|---|---|
title | Sets the title for CometChatIncomingCall | .set(title: String) |
call | Sets the user object for CometChatIncomingCall | .set(call: Call?) |
group | Sets the group object for CometChatIncomingCall | .set(group: Group) |
disablesoundForCalls | Disables sound for calls | .disable(soundForCalls: Bool) |
customSoundForCall | Sets custom sound for calls | .set(customSoundForCalls: URL?) |
acceptButtonText | Sets the text for accept button for CometChatIncomingCall | .set(acceptButtonText: String) |
acceptButtonIcon | Sets the icon for accept button for CometChatIncomingCall | .set(acceptButtonIcon: UIImage) |
declineButtonIcon | Sets the icon for decline button for CometChatIncomingCall | .set(declineButtonIcon: UIImage) |
IncomingCall
component does not provide additional functionalities beyond this level of customization.