Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

blob?: Blob

Blob object

clientAntiSpam?: boolean

indicates whether the text is moderated on the client

custom?: string

Extension field

dataURL?: string

Convert a data URL containing MIME type and Base64 data

env?: string

The environment variable pointing to different types of configurations for state sync and third-party callbacks.

file?: object

The object obtained after uploading the image using the previewFile interface.

Note: If required, after uploading the image using the previewFile interface, send the file using the sendFile interface.

Note 2: Only one of the fileInput, file, filePath, and blob is required.

fileInput?: string | HTMLElement

Select the DOM node or node ID for the file, the SDK will read the file under this node. Do not operate the file under this node before the upload is complete

filePath?: string

Only for Mini program(5.1.0 ), Node.js (5.4.0 ), React Native (5.3.0 ), for example, the mini program gets the temporary file path filePath using wx.chooseImage or wx.startRecord.

idClient: string

To resend a message, the generated idClient must used to identify this message.

nosScene?: string

Storage use case. Global setting by default if unspecified.

nosSurvivalTime?: number

Storage validity time, the default global setting should not be less than one day, in seconds

notifyTargetTags?: string

The target tag of this message. Members with the tag will receive the message; if it is unspecified, use the notifyTargetTags set by the sender when logging in, if it is still missing, the message will be sent to everyone in the chat room

For the matching rules of notifyTargetTags, see the document: Tags

resend: boolean

Whether the message is resent

subType?: number

Custom message subtype, an integer greater than 0.

toAccids?: string[]

String array, the content is the account ID of the recipient. If this field is set and not empty, the message is a chat room directional message (the chat room directional message will not be saved in message history)

type?: "video" | "audio" | "image" | "file"

file filter

  • image will filter out non-picture files, audio will filter out non-audio files, and video will filter out non-video files
  • IE8/IE9 does not support file filtering
yidunAntiCheating?: string

Field for GuardEase Moderator, up to 1024 bytes in JSON string. Example: "{"email":"test@163.com","phone":"12345678901","token":"1234","extension":"hello"}"

yidunAntiSpamExt?: string

Extension field for GuardEase Moderator. JSON string, the maximum length is 1024.

Methods

  • Callback triggered before send a file message

    Parameters

    Returns void

  • Callback for uploading a file

    This callback has a parameter upload, calling upload.abort() can cancel the file upload.

    Note: The second parameter message is supported after v9.11.0

    Note 2: This method is only supported by browsers and WeChat mini Program.

    Parameters

    • upload: { abort: any }
      • [key: string]: any
      • abort:function
        • abort(): void
        • Returns void

    • message: NIMChatroomMessage

    Returns void

  • Callback for upload completion

    Note: The third parameter message is supported after v9.11.0

    Note 2: The third parameter is only supported by browsers and WeChat mini Program

    Parameters

    Returns void

  • Callback for upload progress

    Note: The second parameter message is supported after v9.11.0

    Note 2: This method is only supported by browsers and WeChat mini Program. And don't use it in IE9 and earlier versions due to compatibility issues

    Parameters

    Returns void