addFriendListener

Introduction

Add a friend listener.

  1. Users can receive the following relationship information changes events, only after add a friend listener.

  2. Invoking this method will add a friend listener to current friend listeners array.

Parameter details

Parameter name Parameter type Required Platform Description
listener V2TimFriendshipListener yes All The listener to be added.

Returned template

void

Return value details

This function has no return value

Code example

    V2TimFriendshipListener listener = V2TimFriendshipListener(
      onBlackListAdd: (List<V2TimFriendInfo> infoList) async {
      },
      onBlackListDeleted: (List<String> userList) async {
      },
      onFriendApplicationListAdded:
          (List<V2TimFriendApplication> applicationList) async {
      },
      onFriendApplicationListDeleted: (List<String> userIDList) async {
      },
      onFriendApplicationListRead: () async {
      },
      onFriendInfoChanged: (List<V2TimFriendInfo> infoList) async {
      },
      onFriendListAdded: (List<V2TimFriendInfo> users) async {
      },
      onFriendListDeleted: (List<String> userList) async {
      },
    );
    TencentImSDKPlugin.v2TIMManager
        .getFriendshipManager()
        .addFriendListener(listener: listener);

results matching ""

    No results matching ""