Updated on 2023-03-23 GMT+08:00

Scenario 7: Adding a Participant

Description

You can call the API for adding participants during a meeting.

Service Process

When using the SDK to add participants, call the addAttendee API and implement the API callback function onAddAttendeeResult.

  1. Call an API.

    1. Assemble the data structure AddAttendeeInfo and the API callback function onAddAttendeeResult.
    2. Call the addAttendee API. The data in the preceding step is used as input parameters.

  2. Implement the callback function.

    Implement the onAddAttendeeResult function.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
/**
* Add a participant.
*/
async goToAddAttendee() {
   let _attendees = [{ 
        nickName: "Mike", 
        number: "+991116003543"
    }];
    let param = {
        attendees: _attendees
    }
    const apiService = new ApiService();
    let setResult = await apiService.addAttendee(param);
    if(setResult.ret != 0){
        window.electron.ipcRenderer("show-error-alert", "addAttendee error = " + setResult.ret);
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
/**
* Definition of getConfDetail API in ApiService
*/
async addAttendee(addAttendeeInfo) {
  return new Promise((resolve) => {
    let resultCallback = (ret, reason) => {
      console.log("addAttendee, out data = ", { ret, reason });
      resolve({ ret, reason });
    };
    console.log("addAttendee, in param = ", addAttendeeInfo);
    this.uisdkService.getConfCtrlApi().addAttendee(addAttendeeInfo, resultCallback);
  });
}