Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FriendInterface

Friends APIs

Hierarchy

  • FriendInterface

Implemented by

Index

Methods

  • addFriend(options: { account: string; ps?: string; done?: any }): void
  • applyFriend(options: { account: string; ps?: string; done?: any }): void
  • deleteFriend(options: { account: string; delAlias?: boolean; done?: any }): void
  • getFriends(options: { updateTime?: number; done?: any }): void
  • If you set syncFriends to false when initializing the SDK, the onfriends callback will not be triggered. In this case, this interface can obtain the friend list

    Note: Since the upper limit of the number of friends after v8.9.0 becomes 10,000, the remote protocol does not allow the SDK to send 10,000 friends in one go. There are two ways to get all friends at a time:

    1. If a database is used, this interface will return all valid friend records in the database with updateTime > options.updateTime

    2. If a database is not used, this interface with a timestamp argument will get 3000 records of updateTime > options.timetag from the server. Please handle the pagination logic on your own.

    Parameters

    Returns void

  • isMyFriend(options: { account: string; done?: any }): void
  • Check if the user is included in the friend list

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

    Parameters

    Returns void

  • passFriendApply(options: { account: string; idServer: string; ps?: string; done?: any }): void
  • rejectFriendApply(options: { account: string; idServer: string; ps: string; done?: any }): void
  • updateFriend(options: { account: string; alias?: string; custom?: string; done?: any }): void