Help Center/ Meeting/ Client SDK Reference/ iOS SDK/ Typical Scenarios/ Scenario 5: Creating a Meeting
Updated on 2024-07-30 GMT+08:00

Scenario 5: 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 HWMCreateConfMember 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
31
32
/// Create a meeting.
- (void)creatMeeting {
    HWMCreateConfParam *param = [[HWMCreateConfParam alloc] init];
    param.subject = @"Meeting topic";
    param.confType = HWMConfTypeVideoData;
    param.needPassword = YES; // Whether a password is required for a meeting. By default, no password is required.
    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.isRecordOn = NO; // Whether to enable the meeting recording function. By default, this function is disabled.
    param.joinConfRestrictionType = 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) {
            HWMCreateConfMember *member = [[HWMCreateConfMember 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(@"Create meeting failed.%@", 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.