鸿蒙 IMLib-v1.8.0
    Preparing search index...

    文件消息

    1.0.0

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    name: string = ""

    媒体资源的名称

    localPath: string = ""

    媒体资源的本地路径

    remoteUrl: string = ""

    媒体资源的远端地址

    extra?: string

    消息的附加信息,会随着消息发送出去

    Message.extra

    userInfo?: UserInfo

    消息携带的用户信息

    mentionedInfo?: MentionedInfo

    消息的 @ 信息

    rawString?: string

    消息的原始内容

    SDK 执行消息的 decode 方法正常时,会将数据解析到消息的各个字段,rawString 将会为空

    如果 decode 方法异常时会将消息的原始数据保存在 rawString 中

    destructDuration?: number

    阅后即焚时长,单位秒

    destructDuration <= 0 代表是普通消息
    destructDuration > 0 代表是阅后即焚消息该消息已读后经过 destructDuration 时间后销毁

    1.3.0

    size: number = 0

    文件大小,单位为 Byte

    type: string = ""

    文件类型

    Methods

    • 获取正常的 localPath ,去掉 file://

      在鸿蒙系统内部,沙盒路径需要用 file:// 开头才能被 fs 识别

      原生层使用不能以 file:// 开头

      Parameters

      • localPath: string

      Returns string

    • 将基类的基础数据保存到 map 中

      Returns HashMap<string, Object>

    • 将基类的基础数据从 map 中解析出来

      Parameters

      • map: HashMap<string, Object>

      Returns void

    • 编码方法,将消息转为 json 字符串

      Returns string

      json 字符串

    • 解码方法,将 json 字符串转为消息

      Parameters

      • contentString: string

        json 字符串

      Returns void