Inviting a User to a Call
A new user can be added to an existing call with the following method:
This method triggers the call:incoming event for the invited user and the call:state event for current call members.
The calls.inviteUser()
methods will return a Promise<Call>
object. Once resolved, the new Call object will contain an updated memberStatuses
object reflecting the new 'Ringing...' member.
Example
const inviteUserToCall = async (userId) => {try {this.currentCall = await client.calls.inviteUser(this.currentCall, userId);// this.currentCall.room will be definedconsole.log('Invited user to call', this.currentCall);} catch (e) {console.error('Failed to invite user to call');}};