Help Center/ Meeting/ Client SDK Reference/ macOS SDK/ Typical Scenarios/ Scenario 4: Adding Participants
Updated on 2022-07-11 GMT+08:00

Scenario 4: Adding Participants

Description

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

Service Process

If you need to add participants using the SDK, customize a contact selection page, select the contacts to be added, and add the selected contacts to the meeting.

The macOS SDK supports only customized participant adding.

Sample Code

/// Customize contacts.
- (void)openContactSelectWindow:(NSArray<HWMAttendeeInfo *> *)param scene:(HWMSelectedContactScene)scene completeHander:(void (^)(NSArray<HWMAttendeeInfo *> * _Nullable))handler { 
    HWMSelectContactViewController *contact = [[HWMSelectContactViewController alloc] init];
    [contact setSelectAttendeeInfoHandler:^(NSArray *attendees) {
        NSMutableArray *arr = @[].mutableCopy;
        for (HWMContactInfoModel *model in attendees) {
            HWMAttendeeInfo *info = [[HWMAttendeeInfo alloc] init];
            info.accountId = model.accountId;
            info.name = model.name;
            info.number = model.number;
            info.thirdUserId = model.thirdUserId;
            info.email = model.email;
            info.mute = model.mute;
            info.role = model.role;
            info.sms = model.sms;
            [arr addObject:info];
        }
        if (handler) {
            handler(arr);
        }
    }];
    self.selectContactVC = contact;
    [self presentViewControllerAsModalWindow:contact];
}