Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IBaseSendFileOptions

Hierarchy

Index

Properties

antiSpamInfo?: TMsgAntiSpamInfo

反垃圾相关配置

如果之前已经上传好了文件,那么直接传入 attach 字段 接下来不会再上传它,而是直接发往 IM 服务器

body?: string

文本消息内容,通 IM1 的 text

callbackExt?: string

第三方回调的扩展字段

ext?: string

扩展字段

file?: File

JS 的 File 对象。

浏览器专用

fileInput?: string | HTMLInputElement
deprecated

Use IBaseUploadFileOptions.file instead.

存储文件的 DOM 元素,与上面的 file 只要选填一个就可以了。

浏览器专用

如果传字符串,最后会以 document.getElementById('fileInput').files[0] 拿到 File 对象 如果传的是 DOM 节点,最后以 fileInput.files[0] 拿到 File 对象

filePath?: string

临时文件路径

uni-app,RN,小程序等特殊的 JS 运行环境专用(chooseImage 拿到的临时路径)

idClient?: string

消息客户端唯一标识。只在于重发时可以指定

maxSize?: number

maxSize 限制文件大小。

只对浏览器生效。

uni-app,小程序等,由于sdk只能得到一个 filePath 临时路径,不能得到整个文件的信息。 所以请开发者自行在选择文件后进行判断,参考那些端的API如 wx.chooseImage,uni.chooseImage

nosScenes?: string

存储场景,不传默认实例化配置,默认为"im"

nosSurvivalTime?: number

存储有效时间,不传则默认实例化配置

不得小于一天,单位秒

pushInfo?: TMsgPushInfo

推送相关配置

replyMsg?: IMMessage

被回复的消息体 举例存在一个 A 消息,用户回复这个 A 消息,那么需要在此 replyMsg 里传入 A 消息整体。 其需要的的是以下几个字段: A ==> from、to、time、idServer、idClient A.threadMessageInfo ==> threadMsgFromAccount、threadMsgToAccount、threadMsgTime、threadMsgIdServer、threadMsgIdClient

scene: "p2p" | "team" | "superTeam"

场景

'p2p' (单人聊天) 'team' (群聊) 'superTeam' (超大群聊天)

setting?: TMsgSetting

消息的杂项设置

subType?: number

消息子类型,格式为大于0的整数,开发者可自定义

teamSpecializationInfo?: TMsgTeamSpecializationInfo

群组特化的杂项配置

to: string

接收方, 对方帐号或者群id

Methods

  • 发送前的回调函数,用于发送前拿到这个消息对象 此时这个消息对象还没有 idServer 和准确的 time,并且 status 也只是在 sending

    Parameters

    Returns void

  • 上传前回调事件

    Parameters

    Returns void