差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 后一修订版 两侧同时换到之后的修订记录 | ||
im:web:basics:message [2019/07/04 02:09] zhangdong |
im:web:basics:message [2019/07/22 10:40] zhangdong [发送文本消息(单聊)] |
||
---|---|---|---|
行 11: | 行 11: | ||
* 处理消息 | * 处理消息 | ||
- | * 历史消息 | + | * 拉取历史消息 |
- | + | ||
- | * 撤回消息 | + | |
* 新消息提醒 | * 新消息提醒 | ||
行 53: | 行 51: | ||
msg: 'message content', // 消息内容 | msg: 'message content', // 消息内容 | ||
to: 'username', // 接收消息对象(用户id) | to: 'username', // 接收消息对象(用户id) | ||
- | roomType: false, | + | roomType: false, |
+ | ext: {}, //扩展消息 | ||
success: function (id, serverMsgId) { | success: function (id, serverMsgId) { | ||
console.log('send private text Success'); | console.log('send private text Success'); | ||
行 232: | 行 231: | ||
msg.set({ | msg.set({ | ||
msg: 'msg', | msg: 'msg', | ||
- | to: 'username', //接收消息对象 | + | to: 'username', //接收消息对象 |
- | action : 'action' //用户自定义,cmd消息必填 | + | action : 'action', //用户自定义,cmd消息必填 |
- | ext :{'extmsg':'extends messages'} //用户自扩展的消息内容(群聊用法相同) | + | ext :{'extmsg':'extends messages'}, //用户自扩展的消息内容(群聊用法相同) |
- | success: function ( id,serverMsgId ) {}//消息发送成功回调 | + | success: function ( id,serverMsgId ) {}//消息发送成功回调 |
}); | }); | ||
行 428: | 行 427: | ||
* [[http://webim-h5.easemob.com/jsdoc/out/connection.html#send|send]] | * [[http://webim-h5.easemob.com/jsdoc/out/connection.html#send|send]] | ||
+ | ---- | ||
+ | ===== 消息撤回 ===== | ||
+ | SDK增值服务。 | ||
+ | <code javascript> | ||
+ | /** | ||
+ | * 发送撤回消息 | ||
+ | * @param {Object} option - | ||
+ | * @param {Object} option.mid - 回撤消息id | ||
+ | * @param {Object} option.to - 消息的接收方 | ||
+ | */ | ||
+ | WebIM.conn.recallMessage(option) | ||
+ | </code> | ||
---- | ---- | ||
===== 接收消息 ===== | ===== 接收消息 ===== |