react-native-txim
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -7,24 +7,8 @@ 'use strict'; | ||
const listenerRecentContact = "observeRecentContact";//'最近会话' | ||
const listenerOnlineStatus = "observeOnlineStatus";//'在线状态' | ||
const listenerFriend = "observeFriend";//'联系人' | ||
const listenerTeam = "observeTeam";//'群组' | ||
const listenerReceiveMessage = "observeReceiveMessage";//'接收消息' | ||
const listenerDeleteMessage = "observeDeleteMessage";//'撤销后删除消息' | ||
const listenerReceiveSystemMsg = "observeReceiveSystemMsg";//'系统通知' | ||
const listenerMsgStatus = "observeMsgStatus";//'发送消息状态变化' | ||
const listenerAudioRecord = "observeAudioRecord";//'录音状态' | ||
const listenerUnreadCountChange = "observeUnreadCountChange";//'未读数变化' | ||
const listenerBlackList = "observeBlackList";//'黑名单' | ||
const listenerAttachmentProgress = "observeAttachmentProgress";//'上传下载进度' | ||
const listenerOnKick = "observeOnKick";//'被踢出' | ||
const listenerAccountNotice = "observeAccountNotice";//'账户变动通知' | ||
const listenerLaunchPushEvent = "observeLaunchPushEvent";//'' | ||
const listenerBackgroundPushEvent = "observeBackgroundPushEvent";//'' | ||
class ImInit{ | ||
init(appId, accountType, logLevel){ | ||
return TXIm.init(appId, accountType, logLevel) | ||
init(logLevel){ | ||
const le = 0; | ||
le = logLevel; | ||
return TXIm.init(le) | ||
} | ||
@@ -48,12 +32,3 @@ | ||
} | ||
onlinStatusChange (cb) { | ||
listeners[cb] = DeviceEventEmitter.addListener( | ||
listenerOnKick, | ||
data => { | ||
cb(data) | ||
} | ||
) | ||
} | ||
} | ||
export default new ImInit() |
@@ -12,2 +12,3 @@ 'use strict'; | ||
const listenerReceiveMessage = "observeReceiveMessage";//'接收消息' | ||
const listenerCurrentMessage = "observeCurrentMessage";//接受当前目标消息 | ||
@@ -28,11 +29,26 @@ const listenerDeleteMessage = "observeDeleteMessage";//'撤销后删除消息' | ||
class Message{ | ||
onNewMessage (cb) { | ||
listeners[cb] = DeviceEventEmitter.addListener( | ||
listenerReceiveMessage, | ||
data => { | ||
cb(data) | ||
} | ||
) | ||
/** | ||
* 新建会话 | ||
* @param type | ||
* @param peer | ||
* @returns {*} | ||
*/ | ||
joinChat(type, peer){ | ||
return TXIm.getConversation(type,peer); | ||
} | ||
/** | ||
* 退出会话 | ||
*/ | ||
exitChat(){ | ||
return TXIm.destroyConversation(); | ||
} | ||
/** | ||
* 发送文本消息 | ||
*/ | ||
sendTextMsg(text){ | ||
return TXIm.sendTextMsg(text); | ||
} | ||
} | ||
export default new Message() |
{ | ||
"name": "react-native-txim", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "腾讯IM的RN集成 α版", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
121
4007
34176520