Const
发送 GIF 图片消息
会话信息
消息体,其中 file 为待上传 GIF 图片引用
Optional
上传 GIF 图片过程中的回调钩子,类型为 IUploadHooks 可选
GIF 图片消息配置项,类型为 IGIFMessageOption 可选
发送 GIF 图片消息的快捷方式,等同于使用 new GIFMessage() 创建消息体后调用 sendMessage() 方法,支持 GIF 图片上传,上传成功后自动发送消息
发送 GIF 图片消息示例:
const msgBody = { file }; // file 为待上传 GIF 图片const conversation = {conversationType: RongIMLib.ConversationType.PRIVATE,targetId: 'targetId'}const sendRes = await RongIMLib.sendGIFMessage(conversation, msgBody);console.info('消息发送结果:', sendRes); Copy
const msgBody = { file }; // file 为待上传 GIF 图片const conversation = {conversationType: RongIMLib.ConversationType.PRIVATE,targetId: 'targetId'}const sendRes = await RongIMLib.sendGIFMessage(conversation, msgBody);console.info('消息发送结果:', sendRes);
发送 GIF 图片消息