Ringing
Ring & Notify
You can ring or notify a call. Ring triggers an incoming call style UI for all members of the call. Notify is a smaller notification. Commonly used when someone starts a livestream, joins a zoom style call etc.
val call = client.call("default", "123")
call.create()
call.ring()
call.notify()
// you can also ring and notify as a side effect of joining or creating a call
call.create(ring=true, notify=false)
call.join(ring=true, notify=false)
Users who receive the incoming call can either accept or reject it.
call.accept()
call.reject()
The state for ringing calls is available here:
val incomingCall = client.state.incomingCall.value
val accepted = call.state.acceptedBy.value // list of user ids who accepted
val rejected = call.state.rejectedBy.value // list of user ids who rejected
Push Setup
3 types of push notifications are triggered:
- call.ring
- call.notification
- call.live_started
You can learn more about how to setup push notifications in the docs. The docs also explain how to customize the notifications.
Incoming Calls
The compose SDK provides built-in components to render an incoming call.
- UI Component docs for incoming calls
- UI Cookbook how to build your own incoming call UI