Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SystemMessageInterface

Implemented by

Index

Methods

  • deleteAllLocalSysMsgs(options: { done?: any }): void
  • deleteLocalSysMsg(options: { idServer: string | string[]; done?: any }): void
  • getLocalSysMsgs(options: { lastIdServer?: string; limit?: number; read?: boolean; reverse?: boolean; type?: "custom" | "addFriend" | "applyFriend" | "passFriendApply" | "rejectFriendApply" | "deleteFriend" | "teamInvite" | "rejectTeamInvite" | "applyTeam" | "rejectTeamApply" | "applySuperTeam" | "rejectSuperTeamApply" | "superTeamInvite" | "rejectSuperTeamInvite" | "deleteMsg"; done?: any }): void
  • Get system notifications from the local database

    Parameters

    • options: { lastIdServer?: string; limit?: number; read?: boolean; reverse?: boolean; type?: "custom" | "addFriend" | "applyFriend" | "passFriendApply" | "rejectFriendApply" | "deleteFriend" | "teamInvite" | "rejectTeamInvite" | "applyTeam" | "rejectTeamApply" | "applySuperTeam" | "rejectSuperTeamApply" | "superTeamInvite" | "rejectSuperTeamInvite" | "deleteMsg"; done?: any }
      • Optional lastIdServer?: string

        The idServer of the last system notification in the last query.

      • Optional limit?: number

        limit on the number of queries on one page, the default value is 100

      • Optional read?: boolean

        Whether the notification is read

      • Optional reverse?: boolean

        Query order

        Default value: false. Indicates to search for local system notifications starting from the most recent system notifications. If it is true, search for local system notifications from the first system notification

      • Optional type?: "custom" | "addFriend" | "applyFriend" | "passFriendApply" | "rejectFriendApply" | "deleteFriend" | "teamInvite" | "rejectTeamInvite" | "applyTeam" | "rejectTeamApply" | "applySuperTeam" | "rejectSuperTeamApply" | "superTeamInvite" | "rejectSuperTeamInvite" | "deleteMsg"

        Type

      • done?:function

    Returns void

  • sendCustomSysMsg(options: { apnsText?: string; cc?: boolean; content: string; env?: string; isPushable?: boolean; needPushNick?: boolean; pushPayload?: string; scene: "p2p" | "team" | "superTeam"; sendToOnlineUsersOnly?: boolean; to: string; done?: any }): void
  • Send a custom system notification

    Note, the difference between custom system notification (sendCustoSysmMsg) and custom message (sendCustomMsg) is as follows:

    1. The custom message belongs to NIMMessage, stored in the CommsEase server, delivered to the app server along with other messages, and message history can be queried.
    2. Custom system notifications belongs to NIMSystemMessage, used for notifications on the client, and will not be stored in the CommsEase server, and the history cannot be queried. The SDK only deliver these notifications.

    Example

    Parameters

    • options: { apnsText?: string; cc?: boolean; content: string; env?: string; isPushable?: boolean; needPushNick?: boolean; pushPayload?: string; scene: "p2p" | "team" | "superTeam"; sendToOnlineUsersOnly?: boolean; to: string; done?: any }
      • Optional apnsText?: string

        Custom content for APNS service for system notifications, only valid for recipients of iOS devices.

      • Optional cc?: boolean

        Whether the notification is synced using sync webhooks. The default value is true

      • content: string

        Custom content of the system message, JSON serialized string recommended.

      • Optional env?: string

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

      • Optional isPushable?: boolean

        Whether push notifications is required. Default value: true

      • Optional needPushNick?: boolean

        Whether the nickname is required for push notifications. The default value is false.

      • Optional pushPayload?: string

        Custom content of the system notification, JSON serialized string recommended.

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

        Scenarios are divided into private chat(p2p), group chat(team), and supergroup chat(superTeam).

      • Optional sendToOnlineUsersOnly?: boolean

        Whether to send notifications only to online users. The default value is true.

        true. Only sent to online users, if the receiver is not online, this notification will be discarded. It is suitable for the scene of "typing indicators"

        false. If the recipient is online, the notification will be received immediately. If the recipient is not online, an system notification will be pushed after the recipient goes online.

      • to: string

        Recipient account ID, or group ID.

      • done?:function

    Returns void

  • updateLocalSysMsg(options: { idServer: string; localCustom?: string; state?: string; done?: any }): void
  • Update system notifications in the local database

    Parameters

    Returns void