差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 后一修订版 两侧同时换到之后的修订记录 | ||
im:web:basics:message [2019/07/04 02:11] zhangdong |
im:web:basics:message [2019/07/22 10:42] zhangdong [发送文本消息(群组)] |
||
---|---|---|---|
行 51: | 行 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'); | ||
行 74: | 行 75: | ||
to: 'group id', // 接收消息对象(群组id) | to: 'group id', // 接收消息对象(群组id) | ||
roomType: false, // 群聊类型,true时为聊天室,false时为群组 | roomType: false, // 群聊类型,true时为聊天室,false时为群组 | ||
+ | ext: {}, // 扩展消息 | ||
success: function () { | success: function () { | ||
console.log('send room text success'); | console.log('send room text success'); | ||
行 230: | 行 232: | ||
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 ) {}//消息发送成功回调 |
}); | }); | ||