Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface UserInterface

Hierarchy

  • UserInterface

Implemented by

Index

Methods

  • addToBlacklist(options: { account: string; done?: any }): void
  • Add to the blocklist The onblacklist callback is triggered during initialization and onsyncmarkinblacklist triggered during synchronization across devices.

    Example

    Parameters

    • options: { account: string; done?: any }
      • account: string
      • done?:function
        • done(err: null | NIMCommonError | Error | NIMStrAnyObj, data: { account: string; isAdd: boolean; record: { account: string; updateTime: number } }): void
        • Parameters

          • err: null | NIMCommonError | Error | NIMStrAnyObj
          • data: { account: string; isAdd: boolean; record: { account: string; updateTime: number } }
            • account: string

              Target account ID

            • isAdd: boolean

              Whether the account is included in the blocklist or the list of muted members.

              true: Yes, false: No.

            • record: { account: string; updateTime: number }

              Details of the operation record

              • account: string

                Target account ID

              • updateTime: number

                Update timestamp

          Returns void

    Returns void

  • addToMutelist(options: { account: string; done?: any }): void
  • Add to the list of muted members. The onmutelist callback is triggered during initialization and onsyncmarkinmutelist triggered during synchronization across devices.

    • Apply do-not-disturb by managing a list of muted users.
    • If the muted user send a message, the message will not be forwarded by push notifications.
    • On the UI layer, you can determine whether to render the number of unread messages in the conversation.

    Example

    Parameters

    • options: { account: string; done?: any }
      • account: string
      • done?:function
        • done(err: null | NIMCommonError | Error | NIMStrAnyObj, data: { account: string; isAdd: boolean; record: { account: string; updateTime: number } }): void
        • Parameters

          • err: null | NIMCommonError | Error | NIMStrAnyObj
          • data: { account: string; isAdd: boolean; record: { account: string; updateTime: number } }
            • account: string

              Target account ID

            • isAdd: boolean

              Whether the account is included in the blocklist or the list of muted members.

              true: Yes, false: No.

            • record: { account: string; updateTime: number }

              Details of the operation record

              • account: string

                Target account ID

              • updateTime: number

                Update timestamp

          Returns void

    Returns void

  • getRelations(options: { done?: any }): void
  • Get the blocklist and list of muted members. If you set syncRelations to false when initializing the SDK, you cannot get notified by the onblacklist and onmutelist callbacks. In this case, you can call this interface to get the blocklist and the list of muted members.

    Parameters

    • options: { done?: any }
      • done?:function
        • done(err: null | NIMCommonError | Error | NIMStrAnyObj, data: { blacklist: { account: string; createTime: number; isBlack?: boolean; isMuted?: boolean; updateTime: number }[]; mutelist: { account: string; createTime: number; isBlack?: boolean; isMuted?: boolean; updateTime: number }[] }): void
        • Parameters

          • err: null | NIMCommonError | Error | NIMStrAnyObj
          • data: { blacklist: { account: string; createTime: number; isBlack?: boolean; isMuted?: boolean; updateTime: number }[]; mutelist: { account: string; createTime: number; isBlack?: boolean; isMuted?: boolean; updateTime: number }[] }
            • blacklist: { account: string; createTime: number; isBlack?: boolean; isMuted?: boolean; updateTime: number }[]
              • account: IM account
              • isMuted: * Check if the user is muted.
              • isBlack: Check if a user is included in the blocklist.
            • mutelist: { account: string; createTime: number; isBlack?: boolean; isMuted?: boolean; updateTime: number }[]
              • account: IM account
              • isMuted: * Check if the user is muted.
              • isBlack: Check if a user is included in the blocklist.

          Returns void

    Returns void

  • getUser(options: { account: string; sync?: boolean; done?: any }): void
  • Get the user profile

    Parameters

    • options: { account: string; sync?: boolean; done?: any }
      • account: string

        Account ID

      • Optional sync?: boolean

        Whether to get the account from the server. The default value is false

        Get it from the server if it is true, and get it from the information cached in the local database if it is false.

      • done?:function

    Returns void

  • getUsers(options: { accounts: string[]; sync?: boolean; done?: any }): void
  • Get user profiles. Up to 150 profiles can be retrieved at a time.

    Parameters

    • options: { accounts: string[]; sync?: boolean; done?: any }
      • accounts: string[]

        List of account IDs

      • Optional sync?: boolean

        Whether to get the account from the server. The default value is false

        Get it from the server if it is true, and get it from the information cached in the local database if it is false.

      • done?:function

    Returns void

  • isUserInBlackList(options: { account: string; done?: any }): void
  • Check if a user is in the blocklist

    Note: This interface requires database support. If the local database is not enabled, the done callback will return false

    Parameters

    Returns void

  • removeFromBlacklist(options: { account: string; done?: any }): void
  • Remove from blocklist The onblacklist callback is triggered during initialization and onsyncmarkinblacklist triggered during synchronization across devices.

    Example

    Parameters

    • options: { account: string; done?: any }
      • account: string
      • done?:function
        • done(err: null | NIMCommonError | Error | NIMStrAnyObj, data: { account: string; isAdd: boolean; record: { account: string; updateTime: number } }): void
        • Parameters

          • err: null | NIMCommonError | Error | NIMStrAnyObj
          • data: { account: string; isAdd: boolean; record: { account: string; updateTime: number } }
            • account: string

              Target account ID

            • isAdd: boolean

              Whether the account is included in the blocklist or the list of muted members.

              true: Yes, false: No.

            • record: { account: string; updateTime: number }

              Details of the operation record

              • account: string

                Target account ID

              • updateTime: number

                Update timestamp

          Returns void

    Returns void

  • removeFromMutelist(options: { account: string; done?: any }): void
  • Remove from the list of muted users. The onmutelist callback is triggered during initialization and onsyncmarkinmutelist triggered during synchronization across devices.

    The list of muted users:

    1. determine whether to display the unread count on the UI.
    2. Does not trigger the push service for messages sent by users in the list.

    Example

    Parameters

    • options: { account: string; done?: any }
      • account: string
      • done?:function
        • done(err: null | NIMCommonError | Error | NIMStrAnyObj, data: { account: string; isAdd: boolean; record: { account: string; updateTime: number } }): void
        • Parameters

          • err: null | NIMCommonError | Error | NIMStrAnyObj
          • data: { account: string; isAdd: boolean; record: { account: string; updateTime: number } }
            • account: string

              Target account ID

            • isAdd: boolean

              Whether the account is included in the blocklist or the list of muted members.

              true: Yes, false: No.

            • record: { account: string; updateTime: number }

              Details of the operation record

              • account: string

                Target account ID

              • updateTime: number

                Update timestamp

          Returns void

    Returns void

  • updateMyInfo(options: { antiSpamBusinessId?: string; avatar?: string; birth?: string; custom?: string; email?: string; gender?: "unknown" | "male" | "female"; nick?: string; sign?: string; tel?: string; done?: any }): void
  • Update the profile of the current user. The onmyinfo callback is triggered during initialization and onupdatemyinfo triggered during synchronization across devices.

    Example

    Parameters

    • options: { antiSpamBusinessId?: string; avatar?: string; birth?: string; custom?: string; email?: string; gender?: "unknown" | "male" | "female"; nick?: string; sign?: string; tel?: string; done?: any }
      • Optional antiSpamBusinessId?: string

        Business ID for moderation

      • Optional avatar?: string

        avatar

      • Optional birth?: string

        Date of birth

      • Optional custom?: string

        Extension field

      • Optional email?: string

        Email

      • Optional gender?: "unknown" | "male" | "female"

        Gender

      • Optional nick?: string

        Nickname

      • Optional sign?: string

        Signature

      • Optional tel?: string

        Phone number

      • done?:function

    Returns void