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
  • 获取本地数据库里的系统通知

    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

        上次查询的最后一条系统通知的 idServer

      • Optional limit?: number

        一页查询数量限制,默认 100

      • Optional read?: boolean

        是否已读.

      • Optional reverse?: boolean

        查询顺序

        默认 false. 表示从最近的系统通知开始往前查找本地系统通知. 若为 true 表示从第一条系统通知开始往后查找本地系统通知

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

        类型

      • 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
  • 发送自定义系统通知

    注,自定义系统通知(sendCustoSysmMsg)和自定义消息(sendCustomMsg)的区别如下:

    1. 自定义消息属于 NIMMessage, 会存储在云信服务器消息数据库中, 与其他消息一同传递给开发者,可以查询历史消息,。
    2. 自定义系统通知属于 NIMSystemMessage, 用于第三方通知端侧, 不会存储在云信服务器数据库中,无法查询历史消息。SDK 仅仅负责传递这些通知。

    示例场景

    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

        apns推送文案, 仅对接收方为iOS设备有效

      • Optional cc?: boolean

        是否抄送. 默认 true

      • content: string

        自定义系统消息的内容,推荐传入 JSON 序列化字符串。

      • Optional env?: string

        环境变量,用于指向不同的抄送、第三方回调等配置

      • Optional isPushable?: boolean

        是否需要推送. 默认 true

      • Optional needPushNick?: boolean

        是否需要推送昵称. 默认 false

      • Optional pushPayload?: string

        自定义系统通知的推送属性. 推荐传入 JSON 序列化字符串

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

        场景,跟消息场景的一样分为 p2p, team, superTeam.

      • Optional sendToOnlineUsersOnly?: boolean

        是否只发送给在线用户. 默认为 true

        true. 只发送给在线用户, 如果接收方不在线, 这条通知将被丢弃。适合是“正在输入”这种场景

        false. 若接收方在线, 那么会立即收到该通知,若接收方不在线, 会在其上线后推送离线系统通知。

      • to: string

        接收方,account ID,或者群号。

      • done?:function

    Returns void

  • updateLocalSysMsg(options: { idServer: string; localCustom?: string; state?: string; done?: any }): void
  • 更新本地数据库里的系统通知

    Parameters

    Returns void