tencent cloud

Feedback

uni-app (Anroid&iOS)

Last updated: 2024-04-03 17:23:11
    This article introduces the use of the group call feature, such as initiating a group call and joining a group call.

    Expected outcome

    TUICallKit supports group calls. The expected outcome is shown in the figure below.
    Initiate a group call
    Received Group Call Invitation
    Accept Group Call Invitation
    
    
    
    
    
    
    
    
    

    Create groupID

    Before using the group call feature, you need to create a group first and initiate a group call in an existing group.
    Method one: Create a group by calling the IM API, see IM Group Management for details.
    Method two: Manually create a group through the console, see Console group management for details.

    Group call

    Initiate a group call

    Launch a group call using the groupCall API.
    const TUICallKit = uni.requireNativePlugin('TencentCloud-TUICallKit');
    const options = {
    groupID: 'myGroup',
    userIDList: ['mike', 'tom'],
    callMediaType: 1, // voice call(callMediaType = 1),video call(callMediaType = 2)
    };
    TUICallKit.groupCall(options, (res) => {
    if (res.code === 0) {
    console.log('groupCall success');
    } else {
    console.log(`groupCall failed, error message = ${res.msg}`);
    }
    });

    Join a group call

    Actively join an existing audio and video call in the group by calling the joinInGroupCall API.
    const TUICallKit = uni.requireNativePlugin('TencentCloud-TUICallKit');
    const options = {
    roomID: 9898,
    groupID: 'myGroup',
    callMediaType: 1, // voice call(callMediaType = 1),video call(callMediaType = 2)
    };
    TUICallKit.joinInGroupCall(options, (res) => {
    if (res.code === 0) {
    console.log('joinInGroupCall success');
    } else {
    console.log(`joinInGroupCall failed, error message = ${res.msg}`);
    }
    });
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support