deleteFriendApplication static method

Future<V2TimCallback> deleteFriendApplication({
  1. required int type,
  2. required String userID,
})

Implementation

static Future<V2TimCallback> deleteFriendApplication({
  required int type,
  required String userID,
}) async {
  String userData = Tools.generateUserData();
  Pointer<Uint8> user_data = Tools.string2PointerInt8(userData);
  String param = json.encode({
    "friendship_delete_pendency_param_type": type,
    "friendship_delete_pendency_param_identifier_array": List<String>.from([userID]),
  });
  Pointer<Uint8> json_delete_pendency_param = Tools.string2PointerInt8(param);
  int res = desktopSDK.D_TIMFriendshipDeletePendency(json_delete_pendency_param, user_data);
  if (res != TIMResult.TIM_SUCC) {
    return V2TimCallback.fromJson({
      "code": res,
      "desc": "",
    });
  } else {
    Map<String, dynamic> data = await getAsyncData(apiKey: userData);
    return V2TimCallback.fromJson({
      "code": data["code"],
      "desc": data["desc"],
    });
  }
}