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

Scenario 3: Creating a Meeting

Description

The CreateConf API can be used to create an instant meeting after your login. Participant information is optional.

You can create a meeting only after you log in.

Service Process

If you need to create an instant meeting using the SDK, call the CreateConf API and then implement the callback.

  1. Call the API.

    1. Assemble the HWMCreateConfParam model.
    2. Assemble the HWMAttendeeInfo model array (participants are optional).
    3. Call the CreateConf API to create a meeting. The data in preceding steps is used as input parameters.

  2. Implement the callback.

    Implement the callback.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/// Create a meeting.
- (void)creatMeeting {
    HWMCreateConfParam *param = [[HWMCreateConfParam alloc] init];
    param.subject = @"Meeting topic";
    param.isCameraOn = YES; // Whether to turn on the camera. By default, the camera is turned off.
    param.isMicOn = YES; // Whether to turn on the microphone. By default, the microphone is turned on.
    param.isAutoRecord = NO;// Whether to enable the meeting recording function. By default, this function is disabled.
    param.callInRestrictionType = HWMJoinConfRestrictionAll;// Participants who are allowed to join the meeting.
    // Participant list.
    if (self.selectedMemebrs) {
        __block NSMutableArray *members = [[NSMutableArray alloc] init];
        [self.selectedMemebrs enumerateObjectsUsingBlock:^(HWMContactSelectedModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            HWMAttendeeInfo *member = [[HWMAttendeeInfo alloc] init];
            member.accountId = obj.accountId;
            member.number = obj.number;
            member.name = obj.name;
            member.thirdUserId = obj.thirdUserId;
            [members addObject:member];
        }];
        param.members = members;
    }
    [[HWMSdk getOpenApi] createConf:param callback:^(NSError * _Nullable error, HWMCreateConfResult * _Nullable result) {
        [self hideLoading];
        if (error) {
            NSLog(@"Failed to create the meeting %@", error.localizedDescription);
        }else{
            NSLog(@"Meeting created.");
        }
    }];
}

The participant list is optional for creating a meeting. If such a list is configured, participants will be called after a meeting is created.