2.15.0 • Published 6 days ago
zego-zim-react-native v2.15.0
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('receivePeerMessage', function (zim, { messageList, fromConversationID }) {
console.log('receivePeerMessage', messageList, fromConversationID);
});
// step3: login
var userInfo = { userID: 'xxxx', userName: 'xxxx' };
zim.login(userInfo, '')
.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
});
2.15.0
6 days ago
2.14.1
2 months ago
2.12.1
5 months ago
2.12.0
6 months ago
2.10.0
8 months ago
2.9.0
10 months ago
2.7.0
1 year ago
2.8.0
12 months ago
2.7.1
1 year ago
2.5.0
1 year ago
2.4.0
2 years ago
2.6.0
1 year ago
2.3.0
2 years ago
2.3.1
2 years ago
2.3.3
2 years ago
2.2.3
2 years ago
2.2.0
2 years ago
2.1.7
2 years ago
2.1.6
2 years ago