getGroupOnlineMemberCount static method

Future<V2TimValueCallback<int>> getGroupOnlineMemberCount({
  1. required String groupID,
})

Implementation

static Future<V2TimValueCallback<int>> getGroupOnlineMemberCount({
  required String groupID,
}) async {
  String userData = Tools.generateUserData();
  Pointer<Uint8> user_data = Tools.string2PointerInt8(userData);
  Pointer<Uint8> group_id = Tools.string2PointerInt8(groupID);
  int res = desktopSDK.D_TIMGroupGetOnlineMemberCount(group_id, user_data);
  if (res != TIMResult.TIM_SUCC) {
    return V2TimValueCallback<int>.fromJson({
      "code": res,
      "desc": "",
    });
  } else {
    Map<String, dynamic> data = await getAsyncData(apiKey: userData);
    Map<String, dynamic> nativeData = Map<String, dynamic>.from(json.decode(data["json_param"].isEmpty ? json.encode({}) : data["json_param"]));

    return V2TimValueCallback<int>.fromJson({"code": data["code"], "desc": data["desc"], "data": nativeData["group_get_online_member_count_result"]});
  }
}