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.
Global level styling
Property | Description | Code |
---|---|---|
overlayBackgroundColor | Background color for the overlay. | overlayBackgroundColor: UIColor |
acceptButtonBackgroundColor | Background color for the accept button. | acceptButtonBackgroundColor: UIColor |
rejectButtonBackgroundColor | Background color for the reject button. | rejectButtonBackgroundColor: UIColor |
acceptButtonTintColor | Tint color for the accept button. | acceptButtonTintColor: UIColor |
rejectButtonTintColor | Tint color for the reject button. | rejectButtonTintColor: UIColor |
acceptButtonImage | Icon image for the accept button. | acceptButtonImage: UIImage |
rejectButtonImage | Icon image for the reject button. | rejectButtonImage: UIImage |
acceptButtonCornerRadius | Sets corner radius for accept button | acceptButtonCornerRadius: CometChatCornerStyle? |
rejectButtonCornerRadius | Sets corner radius for reject button | rejectButtonCornerRadius: CometChatCornerStyle? |
acceptButtonBorderWidth | Sets border width for accept button | acceptButtonBorderWidth: CGFloat? |
rejectButtonBorderWidth | Sets border width for reject button | rejectButtonBorderWidth: CGFloat? |
acceptButtonBorderColor | Sets border color for accept button | acceptButtonBorderColor: UIColor? |
rejectButtonBorderColor | Sets border color for reject button | rejectButtonBorderColor: UIColor? |
backgroundColor | Background color for the call view. | backgroundColor: UIColor |
cornerRadius | Corner radius for the view. | cornerRadius: nil |
borderColor | Border color for the view. | borderColor: UIColor |
borderWidth | Border width for the view. | borderWidth: CGFloat |
callLabelColor | Text color for the call label. | callLabelColor: UIColor |
callLabelFont | Font for the call label. | callLabelFont: UIFont |
nameLabelColor | Text color for the name label. | nameLabelColor: UIColor |
nameLabelFont | Font for the name label. | nameLabelFont: UIFont |
Property | Description | Code |
---|---|---|
disableSoundForCalls | Disables sound for incoming calls. | disableSoundForCalls = true |
setCustomSoundForCalls | Sets a custom sound for incoming calls. | set(customSoundForCalls: URL) |
UIView
.
UIView
.
CustomTitleView
as a custom UIView
. Which we will inflate in setTitleView()