Tencent Chat SDK for React native
Tencent Cloud's official IM React Native SDK
can easily integrate chat, conversation, group, and data management capabilities to help you send and receive rich media messages such as text, pictures, short voices, and short videos, fully meeting communication needs.
About Tencent Cloud Chat
Tencent Cloud Chat provides globally interconnected chat APIs, multi-platform SDKs, and UIKit components to help you quickly bring messaging capabilities such as one-to-one chat, group chat, chat rooms, and system notifications to your applications and websites.
Through the official React Native SDK react-native-tim-js, you can efficiently integrate real-time chat into your client app.
You can sign up for a Tencent Cloud account at here.
Explore more docs about Tencent Cloud Chat.
Commonly Used Scenarios
Installation
npm install react-native-tim-js
yarn add react-native-tim-js
Prerequisites
- You have signed up for a Tencent Cloud account,and completed identity verification。
- Please refer to Creating and Upgrading an Application and create an app,record its
SDKAppID
。
Getting started
import { TencentImSDKPlugin } from 'react-native-tim-js';
const timManger = TencentImSDKPlugin.v2TIMManager;
const groupManager = timManager.getGroupManager();
const messageManager = timManager.getMessageManager();
const friendshipManager = timManager.getFriendshipManager();
const conversationManager = timManager.getConversationManager();
const offlinePushManager = timManager.getOfflinePushManager();
const signalingManager = timManager.getSignalingManager();
const sdkAppID = 0;
const logLevel = LogLevelEnum.V2TIM_LOG_DEBUG;
await timManger.initSDK(sdkAppID, logLeve);
const userID = 123456;
const userSig = "xxx";
timManger.login(userID, userSig);
const friendID = 456789;
const text = "Hello, Tencent IM";
timManger.sendC2CTextMessage(friendID, text);
timManager.logout();
API Docs & Changelogs
If you want to find out more api docs about react-native-tim-js, go to Docs.
If you want to check the record of SDK versions, go to Change Log.
Reference