发送文本消息
会话信息
消息体
Optional
发送消息配置项
发送文本消息的快捷方式,等同于使用 new TextMessage() 创建消息体后调用 sendMessage() 方法
发送文本消息示例:
const messageBody = {content: 'hello world'};const conversation = {conversationType: RongIMLib.ConversationType.PRIVATE,targetId: 'targetId'}const sendRes = await RongIMLib.sendTextMessage(conversation, messageBody);console.info('消息发送结果:', sendRes); Copy
const messageBody = {content: 'hello world'};const conversation = {conversationType: RongIMLib.ConversationType.PRIVATE,targetId: 'targetId'}const sendRes = await RongIMLib.sendTextMessage(conversation, messageBody);console.info('消息发送结果:', sendRes);
发送文本消息