Socket
Book a DemoInstallSign in
Socket

zego-zim-react-native

Package Overview
Dependencies
Maintainers
13
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zego-zim-react-native

Zego ZIM SDK for React Native

latest
npmnpm
Version
2.24.0
Version published
Maintainers
13
Created
Source

zego-zim-react-native

Getting started

$ npm install zego-zim-react-native --save

Mostly automatic installation

$ react-native link zego-zim-react-native

Usage

import ZIM from 'zego-zim-react-native';

// step1: create zim instance
var appID = 0;
var appSign = '';
ZIM.create({ appID, appSign });
var zim = ZIM.getInstance();

// step2: register callback function
zim.on('peerMessageReceived', function (zim, { messageList, info, fromConversationID }) {
    console.log('peerMessageReceived', messageList, fromConversationID);
});

// step3: login
var userID = 'xxxx';
var loginConfig = { userName: 'xxxx', token: '' };
zim.login(userID, loginConfig)
    .then(function () {
        // success
    })
    .catch(function (err) {
        // failed
    });

// step4: send peer text message
var toUserID = 'xxxx1';
var config = { 
    priority: 1 // priority,low:1, medium:2, high:3
};


var messageTextObj = { type: 1, message: 'TEXT CONTENT' };
zim.sendMessage(messageTextObj, toUserID, 0, config)
    .then(function ({ message }) {
        // success
    })
    .catch(function (err) {
        // failed
    });

Keywords

zego

FAQs

Package last updated on 06 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts