2.9.0 • Published 5 months ago

@tencentcloud/call-uikit-react-native v2.9.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

TUICallKit is a UIKit component for audio and video calls.

NPM verison NPM downloads Documents Stars

Introduction

TUICallKit is a UIKit component for audio and video calls developed by Tencent Cloud. By integrating this component, you can easily add video calling functionality to your app with just a few lines of code.

Install

yarn add @tencentcloud/call-uikit-react-native

Activate Service

  • copy the debug directory to your project directory src/debug, it is necessary when generating userSig locally.

    # macOS
    cp -r node_modules/@tencentcloud/call-uikit-react-native/src/debug ./src
    
    # windows
    xcopy node_modules\@tencentcloud\call-uikit-react\src\debug .\src\debug /i /e
  • Go to the Activate Service page and get the SDKAppID and SDKSecretKey, then fill them in the GenerateTestUserSig-es.js file.

Usage

import { TUICallKit, MediaType, TUICallEvent } from "@tencentcloud/call-uikit-react-native";
import { genTestUserSig } from '../../debug/GenerateTestUserSig-es';

TUICallKit.login

const handleLogin = () => {
  const userID = 'Alice'
  const { SDKAppID, userSig } = genTestUserSig({ userID });

  TUICallKit.login(
    {
      sdkAppId: SDKAppID,
      userId: userID,
      userSig,
    },
    (res) => {
      console.log('login success', res);
    },
    (errCode, errMsg) => {
      console.log('login error', errCode, errMsg);
    }
  );
};

TUICallKit.call

const call = () => {
  TUICallKit.call(
    {
      userId: 'denny',
      mediaType: MediaType.Video,
    },
    () => {
      console.log('call success');
    },
    () => {
      console.log('call error');
    }
  );
};

TUICallKit.groupCall

const groupCall = () => {
  TUICallKit.groupCall(
    {
      userIdList: ['mike', 'denny'],
      mediaType: MediaType.Video,
      groupId: 'xxx',
    },
    (res) => {
      console.log('groupCall success', res);
    },
    (errCode, errMsg) => {
      console.log('groupCall error', errCode, errMsg);
    }
  );
};

FAQs

2.9.0

5 months ago

2.0.3

6 months ago

2.0.4

5 months ago

2.0.2

7 months ago

2.0.1-beta.2

7 months ago

2.0.1-beta.1

7 months ago

2.0.1

7 months ago

2.0.0

7 months ago

1.0.0

8 months ago

0.1.0

8 months ago

0.1.0-beta.3

8 months ago

0.1.0-beta.2

8 months ago

0.1.0-beta.1

8 months ago

0.1.0-beta.0

8 months ago