Options
All
  • Public
  • Public/Protected
  • All
Menu

export manager

Hierarchy

  • BaseManager
    • ChatContactManager

Index

Constructors

Properties

_contactListeners: Set<ChatContactEventListener>
_contactSubscriptions: Map<string, EmitterSubscription>
_eventEmitter?: NativeEventEmitter
TAG: string = 'ChatContactManager'

Methods

  • acceptInvitation(userId: string): Promise<void>
  • Accepts a friend invitation。

    throws

    A description of the exception. See ChatError.

    Parameters

    • userId: string

      The user who sends the friend invitation.

    Returns Promise<void>

  • addContact(userId: string, reason?: string): Promise<void>
  • Adds a new contact.

    throws

    A description of the exception. See ChatError.

    Parameters

    • userId: string

      The user ID of the contact to add.

    • reason: string = ''

      The reason for adding the contact. This parameter is optional and can be null or "".

    Returns Promise<void>

  • addUserToBlockList(userId: string): Promise<void>
  • Adds a contact to the block list.

    You can send messages to the users on the block list, but cannot receive messages from them.

    throws

    A description of the exception. See ChatError.

    Parameters

    • userId: string

      The user ID of the contact to be added to the block list.

    Returns Promise<void>

  • declineInvitation(userId: string): Promise<void>
  • Declines a friend invitation.

    throws

    A description of the exception. See ChatError.

    Parameters

    • userId: string

      The user who sends the friend invitation.

    Returns Promise<void>

  • deleteContact(userId: string, keepConversation?: boolean): Promise<void>
  • Deletes a contact and all the related conversations.

    throws

    A description of the exception. See ChatError.

    Parameters

    • userId: string

      The user ID of the contact to delete.

    • keepConversation: boolean = false

      Whether to retain conversations of the contact to delete.

      • true: Yes.
      • (Default) false: No.

    Returns Promise<void>

  • getAllContactsFromDB(): Promise<string[]>
  • Gets the contact list from the local database.

    throws

    A description of the exception. See ChatError.

    Returns Promise<string[]>

    The contact list.

  • getAllContactsFromServer(): Promise<string[]>
  • Gets the contact list from the server.

    throws

    A description of the exception. See ChatError.

    Returns Promise<string[]>

    The list of contacts.

  • getBlockListFromDB(): Promise<string[]>
  • Gets the block list from the local database.

    throws

    A description of the exception. See ChatError.

    Returns Promise<string[]>

    The block list obtained from the local database.

  • getBlockListFromServer(): Promise<string[]>
  • Gets the block list from the server.

    throws

    A description of the exception. See ChatError.

    Returns Promise<string[]>

    The block list obtained from the server.

  • getSelfIdsOnOtherPlatform(): Promise<string[]>
  • Gets the unique IDs of the current user on the other devices. The ID is in the format of {user_ID} + "/" + {resource_ID}.

    throws

    A description of the exception. See ChatError.

    Returns Promise<string[]>

    The list of unique IDs of users on the other devices if the method succeeds.

  • invokeContactListener(params: any): void
  • Parameters

    • params: any

    Returns void

  • removeAllContactListener(): void
  • Removes all contact listeners.

    Returns void

  • removeUserFromBlockList(userId: string): Promise<void>
  • Removes the contact from the block list.

    throws

    A description of the exception. See ChatError.

    Parameters

    • userId: string

      The user ID of the contact to be removed from the block list.

    Returns Promise<void>

  • setNativeListener(event: NativeEventEmitter): void
  • Parameters

    • event: NativeEventEmitter

    Returns void

  • _callMethod<T>(method: string, args?: {}): Promise<T>
  • Type Parameters

    • T

    Parameters

    • method: string
    • Optional args: {}

      Returns Promise<T>

    • checkErrorFromResult(result: any): void
    • Parameters

      • result: any

      Returns void

    • handleGroupFileCallback(methodName: string, self: BaseManager, groupId: string, filePath: string, callback?: ChatGroupFileStatusCallback): void
    • Parameters

      Returns void

    Generated using TypeDoc