getGroupMemberList
(Android / iOS & Mac / Windows) 获取指定群的群成员列表。
该列表中包含了各个群成员的资料信息,例如用户 ID(userID
)、群名片(nameCard
)、头像(faceUrl
)、昵称(nickName
)、进群时间(joinTime
)、在线状态(isOnline
)等信息。getGroupMemberList
拉取最近进群的 1000 位群成员。此功能需要在控制台开启开关,开关路径:Applications > Your App > Chat > Configuration > Group Configuration > Group feature configuration > List of online audio-video group members。filter
)和分页拉取(nextSeq
)两个高级特性。getGroupMemberList
(Android / iOS & Mac / Windows) 接口时,您可以指定 filter
为 V2TIMGroupMemberFilter
,拉取特定角色列表。过滤器 | 过滤类型 |
V2TIM_GROUP_MEMBER_FILTER_ALL | 拉取所有群成员的信息列表 |
V2TIM_GROUP_MEMBER_FILTER_OWNER | 仅拉取群主的信息列表 |
V2TIM_GROUP_MEMBER_FILTER_ADMIN | 仅拉取群管理员的信息列表 |
V2TIM_GROUP_MEMBER_FILTER_COMMON | 仅拉取普通群成员的信息列表 |
// 通过 filter 参数指定只拉取群主的资料int role = V2TIMGroupMemberFullInfo.V2TIM_GROUP_MEMBER_FILTER_OWNER;V2TIMManager.getGroupManager().getGroupMemberList("testGroup", role, 0,new V2TIMValueCallback<V2TIMGroupMemberInfoResult>() {@Overridepublic void onError(int code, String desc) {// 拉取失败}@Overridepublic void onSuccess(V2TIMGroupMemberInfoResult v2TIMGroupMemberInfoResult) {// 拉取成功}});
[[V2TIMManager sharedInstance] getGroupMemberList:@"groupA" filter:V2TIM_GROUP_MEMBER_FILTER_OWNER nextSeq:0 succ:^(uint64_t nextSeq, NSArray<V2TIMGroupMemberFullInfo *> *memberList) {// 拉取成功} fail:^(int code, NSString *desc) {// 拉取失败}];
template <class T>class ValueCallback final : public V2TIMValueCallback<T> {public:using SuccessCallback = std::function<void(const T&)>;using ErrorCallback = std::function<void(int, const V2TIMString&)>;ValueCallback() = default;~ValueCallback() override = default;void SetCallback(SuccessCallback success_callback, ErrorCallback error_callback) {success_callback_ = std::move(success_callback);error_callback_ = std::move(error_callback);}void OnSuccess(const T& value) override {if (success_callback_) {success_callback_(value);}}void OnError(int error_code, const V2TIMString& error_message) override {if (error_callback_) {error_callback_(error_code, error_message);}}private:SuccessCallback success_callback_;ErrorCallback error_callback_;};V2TIMString groupID = "testGroup";// 通过 filter 参数指定只拉取群主的资料uint32_t filter = V2TIMGroupMemberFilter::V2TIM_GROUP_MEMBER_FILTER_OWNER;uint64_t nextSeq = 0;auto callback = new ValueCallback<V2TIMGroupMemberInfoResult>{};callback->SetCallback([=](const V2TIMGroupMemberInfoResult& groupMemberInfoResult) {// 拉取成功delete callback;},[=](int error_code, const V2TIMString& error_message) {// 拉取失败delete callback;});V2TIMManager::GetInstance()->GetGroupManager()->GetGroupMemberList(groupID, filter, nextSeq, callback);
getGroupMemberList
时,指定参数 nextSeq
为 0(表示从头开始拉取会话列表),一次最多拉取 50 个群成员对象。getGroupMemberList
的回调结果 V2TIMGroupMemberInfoResult
中会包含 nextSeq
(下次分页拉取的字段):nextSeq
等于 0,表示已经拉取了全部的群成员。nextSeq
大于 0,表示还有更多的群成员可以拉取。此时并不意味着要立刻开始拉取 “下一页” 的成员列表。在常见的软件中,分页拉取通常由用户的滑动操作触发的,用户通过上拉触发一次分页拉取。getGroupMemberList
接口,并传入新一轮的 nextSeq
参数(nextSeq
数值来自上一次拉取返回的 V2TIMGroupMemberInfoResult
对象)。nextSeq
等于 0,拉取结束。{...long nextSeq = 0;getGroupMemberList(nextSeq);...}public void getGroupMemberList(long nextSeq) {int filterRole = V2TIMGroupMemberFullInfo.V2TIM_GROUP_MEMBER_FILTER_ALL;V2TIMManager.getGroupManager().getGroupMemberList("testGroup", filterRole, nextSeq,new V2TIMValueCallback<V2TIMGroupMemberInfoResult>() {@Overridepublic void onError(int code, String desc) {// 拉取失败}@Overridepublic void onSuccess(V2TIMGroupMemberInfoResult groupMemberInfoResult) {if (groupMemberInfoResult.getNextSeq() != 0) {// 继续分页拉取getGroupMemberList(groupMemberInfoResult.getNextSeq());...} else {// 拉取结束}}});}
- (void)getGroupMemberList:(uint32_t)seq {[[V2TIMManager sharedInstance] getGroupMemberList:@"groupA" filter:V2TIM_GROUP_MEMBER_FILTER_OWNER nextSeq:seq succ:^(uint64_t nextSeq, NSArray<V2TIMGroupMemberFullInfo *> *memberList) {if (nextSeq != 0) {// 继续分页拉取[self getGroupMemberList:nextSeq];//...} else {// 拉取结束}} fail:^(int code, NSString *desc) {// 拉取失败}];}
template <class T>class ValueCallback final : public V2TIMValueCallback<T> {public:using SuccessCallback = std::function<void(const T&)>;using ErrorCallback = std::function<void(int, const V2TIMString&)>;ValueCallback() = default;~ValueCallback() override = default;void SetCallback(SuccessCallback success_callback, ErrorCallback error_callback) {success_callback_ = std::move(success_callback);error_callback_ = std::move(error_callback);}void OnSuccess(const T& value) override {if (success_callback_) {success_callback_(value);}}void OnError(int error_code, const V2TIMString& error_message) override {if (error_callback_) {error_callback_(error_code, error_message);}}private:SuccessCallback success_callback_;ErrorCallback error_callback_;};V2TIMString groupID = "testGroup";uint32_t filter = V2TIMGroupMemberFilter::V2TIM_GROUP_MEMBER_FILTER_ALL;uint64_t nextSeq = 0;auto callback = new ValueCallback<V2TIMGroupMemberInfoResult>{};callback->SetCallback([=](const V2TIMGroupMemberInfoResult& groupMemberInfoResult) {if (groupMemberInfoResult.nextSequence != 0) {// 继续分页拉取 ...}delete callback;},[=](int error_code, const V2TIMString& error_message) {// 拉取失败delete callback;});V2TIMManager::GetInstance()->GetGroupManager()->GetGroupMemberList(groupID, filter, nextSeq, callback);
muteGroupMember
(Android / iOS & Mac / Windows),设置 muteTime
(单位为秒) 禁言某一个群成员。例如设置 muteTime
为 120,表示禁言该成员持续 120 秒。
某群成员被禁言后,发送消息会失败,并接收到相应的错误码。如果想取消该成员的禁言,可以将 muteTime
设置为 0。muteAllGroupMembers
(Android / iOS & Mac / Windows) 接口对整个群进行禁言,将 isMute
字段设置为 true
/YES
即可,解除禁言则设置为 false/NO
。全群禁言没有时间限制。// 禁言群成员 userB 1分钟V2TIMManager.getGroupManager().muteGroupMember("groupA", "userB", 60, new V2TIMCallback() {@Overridepublic void onSuccess() {// 禁言群成员成功}@Overridepublic void onError(int code, String desc) {// 禁言群成员失败}});// 全员禁言// 全员禁言V2TIMManager.getGroupManager().muteAllGroupMembers("groupA", true, new V2TIMCallback() {@Overridepublic void onSuccess() {// 全员禁言成功}@Overridepublic void onError(int code, String desc) {// 全员禁言失败}});V2TIMManager.getInstance().addGroupListener(new V2TIMGroupListener() {@Overridepublic void onMemberInfoChanged(String groupID, List<V2TIMGroupMemberChangeInfo> v2TIMGroupMemberChangeInfoList) {// 禁言群成员监听for (V2TIMGroupMemberChangeInfo memberChangeInfo : v2TIMGroupMemberChangeInfoList) {// 被禁言用户 IDString userID = memberChangeInfo.getUserID();// 禁言时间long muteTime = memberChangeInfo.getMuteTime();}}@Overridepublic void onAllGroupMembersMuted(String groupID, boolean isMute) {// 全员禁言监听}});
// 禁言群成员 user1 1分钟[[V2TIMManager sharedInstance] muteGroupMember:@"groupA" member:@"user1" muteTime:60 succ:^{// 禁言群成员成功} fail:^(int code, NSString *desc) {// 禁言群成员失败}];// 全员禁言[[V2TIMManager sharedInstance] muteAllGroupMembers:@"groupA" isMute:YES succ:^{// 全员禁言成功} fail:^(int code, NSString *desc) {// 全员禁言失败}];[[V2TIMManager sharedInstance] addGroupListener:self];- (void)onMemberInfoChanged:(NSString *)groupID changeInfoList:(NSArray <V2TIMGroupMemberChangeInfo *> *)changeInfoList {// 禁言群成员监听for (V2TIMGroupMemberChangeInfo *memberChangeInfo in changeInfoList) {// 被禁言用户 IDNSString *userID = memberChangeInfo.userID;// 禁言时间uint32_t muteTime = memberChangeInfo.muteTime;}}- (void)onAllGroupMembersMuted:(NSString *)groupID isMute:(BOOL)isMute {// 全员禁言监听}
class Callback final : public V2TIMCallback {public:using SuccessCallback = std::function<void()>;using ErrorCallback = std::function<void(int, const V2TIMString&)>;Callback() = default;~Callback() override = default;void SetCallback(SuccessCallback success_callback, ErrorCallback error_callback) {success_callback_ = std::move(success_callback);error_callback_ = std::move(error_callback);}void OnSuccess() override {if (success_callback_) {success_callback_();}}void OnError(int error_code, const V2TIMString& error_message) override {if (error_callback_) {error_callback_(error_code, error_message);}}private:SuccessCallback success_callback_;ErrorCallback error_callback_;};// 禁言群成员 userB 1分钟auto callback = new Callback;callback->SetCallback([=]() {// 禁言群成员成功delete callback;},[=](int error_code, const V2TIMString& error_message) {// 禁言群成员失败delete callback;});V2TIMManager::GetInstance()->GetGroupManager()->MuteGroupMember("groupA", "userB", 60, callback);// 全员禁言callback->SetCallback([=]() {// 全员禁言成功delete callback;},[=](int error_code, const V2TIMString& error_message) {// 全员禁言失败delete callback;});V2TIMManager::GetInstance()->GetGroupManager()->muteAllGroupMembers("groupA", true, callback);// 监听禁言群成员/全员禁言通知class GroupListener final : public V2TIMGroupListener {public:GroupListener() = default;~GroupListener() override = default;void OnMemberInfoChanged(const V2TIMString& groupID,const V2TIMGroupMemberChangeInfoVector& groupMemberChangeInfoList) override {// 禁言群成员监听for (size_t i = 0; i < groupMemberChangeInfoList.Size(); ++i) {const V2TIMGroupMemberChangeInfo& groupMemberChangeInfo = groupMemberChangeInfoList[i];// 被禁言用户 IDV2TIMString userID = groupMemberChangeInfo.userID;// 禁言时间uint32_t muteTime = groupMemberChangeInfo.muteTime;}}void onAllGroupMembersMuted(const V2TIMString& groupID,bool isMute) override {// 全员禁言监听}// 其他成员 ...};// 添加群事件监听器,注意在移除监听器之前需要保持 groupListener 的生命期,以免接收不到事件回调GroupListener groupListener;V2TIMManager::GetInstance()->AddGroupListener(&groupListener);
kickGroupMember
① (Android / iOS & Mac / Windows) 接口可以将指定的群成员踢出群组。群成员被踢后,全员(包括被踢的人)都会收到 onMemberKicked
(Android / iOS & Mac / Windows) 回调。List<String> userIDList = new ArrayList<>();userIDList.add("userB");V2TIMManager.getGroupManager().kickGroupMember("groupA", userIDList, "", newV2TIMValueCallback<List<V2TIMGroupMemberOperationResult>>() {@Overridepublic void onSuccess(List<V2TIMGroupMemberOperationResult> v2TIMGroupMemberOperationResults) {// 踢人成功}@Overridepublic void onError(int code, String desc) {// 踢人失败}});V2TIMManager.getInstance().addGroupListener(new V2TIMGroupListener() {@Overridepublic void onMemberKicked(String groupID, V2TIMGroupMemberInfo opUser,List<V2TIMGroupMemberInfo> memberList) {// 群成员被踢通知}});
[[V2TIMManager sharedInstance] kickGroupMember:@"groupA" memberList:@[@"user1"] reason:@"" succ:^(NSArray<V2TIMGroupMemberOperationResult *> *resultList) {// 踢人成功} fail:^(int code, NSString *desc) {// 踢人失败}];[[V2TIMManager sharedInstance] addGroupListener:self];- (void)onMemberKicked:(NSString *)groupID opUser:(V2TIMGroupMemberInfo *)opUser memberList:(NSArray<V2TIMGroupMemberInfo *>*)memberList {// 群成员被踢通知}
template <class T>class ValueCallback final : public V2TIMValueCallback<T> {public:using SuccessCallback = std::function<void(const T&)>;using ErrorCallback = std::function<void(int, const V2TIMString&)>;ValueCallback() = default;~ValueCallback() override = default;void SetCallback(SuccessCallback success_callback, ErrorCallback error_callback) {success_callback_ = std::move(success_callback);error_callback_ = std::move(error_callback);}void OnSuccess(const T& value) override {if (success_callback_) {success_callback_(value);}}void OnError(int error_code, const V2TIMString& error_message) override {if (error_callback_) {error_callback_(error_code, error_message);}}private:SuccessCallback success_callback_;ErrorCallback error_callback_;};V2TIMString groupID = "groupA";V2TIMStringVector memberList;memberList.PushBack("userB");auto callback = new ValueCallback<V2TIMGroupMemberOperationResultVector>{};callback->SetCallback([=](const V2TIMGroupMemberOperationResultVector& groupMemberOperationResultList) {// 踢人成功delete callback;},[=](int error_code, const V2TIMString& error_message) {// 踢人失败delete callback;});V2TIMManager::GetInstance()->GetGroupManager()->KickGroupMember(groupID, memberList, {}, callback);// 监听群成员被踢通知class GroupListener final : public V2TIMGroupListener {public:GroupListener() = default;~GroupListener() override = default;void OnMemberKicked(const V2TIMString& groupID, const V2TIMGroupMemberInfo& opUser, const V2TIMGroupMemberInfoVector& memberList) override {// 群成员被踢通知}};// 添加群事件监听器,注意在移除监听器之前需要保持 groupListener 的生命期,以免接收不到事件回调GroupListener groupListener;V2TIMManager::GetInstance()->AddGroupListener(&groupListener);
kickGroupMember
② (Android / iOS & Mac / Windows) 接口做了功能升级,新增 duration
参数,用于指定用户被踢出群组开始算起,禁止重新申请加群的时长。List<String> userIDList = new ArrayList<>();userIDList.add("userB");V2TIMManager.getGroupManager().kickGroupMember("groupA", userIDList, "", 100, newV2TIMValueCallback<List<V2TIMGroupMemberOperationResult>>() {@Overridepublic void onSuccess(List<V2TIMGroupMemberOperationResult> v2TIMGroupMemberOperationResults) {// 踢人成功}@Overridepublic void onError(int code, String desc) {// 踢人失败}});V2TIMManager.getInstance().addGroupListener(new V2TIMGroupListener() {@Overridepublic void onMemberKicked(String groupID, V2TIMGroupMemberInfo opUser,List<V2TIMGroupMemberInfo> memberList) {// 群成员被踢通知}});
[[V2TIMManager sharedInstance] kickGroupMember:@"groupA" memberList:@[@"user1"] reason:@"" duration:100 succ:^(NSArray<V2TIMGroupMemberOperationResult *> *resultList) {// 踢人成功} fail:^(int code, NSString *desc) {// 踢人失败}];[[V2TIMManager sharedInstance] addGroupListener:self];- (void)onMemberKicked:(NSString *)groupID opUser:(V2TIMGroupMemberInfo *)opUser memberList:(NSArray<V2TIMGroupMemberInfo *>*)memberList {// 群成员被踢通知}
template <class T>class ValueCallback final : public V2TIMValueCallback<T> {public:using SuccessCallback = std::function<void(const T&)>;using ErrorCallback = std::function<void(int, const V2TIMString&)>;ValueCallback() = default;~ValueCallback() override = default;void SetCallback(SuccessCallback success_callback, ErrorCallback error_callback) {success_callback_ = std::move(success_callback);error_callback_ = std::move(error_callback);}void OnSuccess(const T& value) override {if (success_callback_) {success_callback_(value);}}void OnError(int error_code, const V2TIMString& error_message) override {if (error_callback_) {error_callback_(error_code, error_message);}}private:SuccessCallback success_callback_;ErrorCallback error_callback_;};V2TIMString groupID = "groupA";V2TIMStringVector memberList;memberList.PushBack("userB");auto callback = new ValueCallback<V2TIMGroupMemberOperationResultVector>{};callback->SetCallback([=](const V2TIMGroupMemberOperationResultVector& groupMemberOperationResultList) {// 踢人成功delete callback;},[=](int error_code, const V2TIMString& error_message) {// 踢人失败delete callback;});V2TIMManager::GetInstance()->GetGroupManager()->KickGroupMember(groupID, memberList, {}, 100, callback);// 监听群成员被踢通知class GroupListener final : public V2TIMGroupListener {public:GroupListener() = default;~GroupListener() override = default;void OnMemberKicked(const V2TIMString& groupID, const V2TIMGroupMemberInfo& opUser,const V2TIMGroupMemberInfoVector& memberList) override {// 群成员被踢通知}};// 添加群事件监听器,注意在移除监听器之前需要保持 groupListener 的生命期,以免接收不到事件回调GroupListener groupListener;V2TIMManager::GetInstance()->AddGroupListener(&groupListener);
muteGroupMember
(Android / iOS & Mac / Windows) 禁言指定成员达到类似的成员管控的目的,禁言操作参考 禁言。setGroupMemberRole
(Android / iOS & Mac / Windows) 可以对陌生人社交群(Public)、临时会议群(Meeting)和直播群(AVChatRoom)中的群成员进行管理员授权。V2TIMManager.getGroupManager().setGroupMemberRole("groupA", "userB", V2TIMGroupMemberFullInfo.V2TIM_GROUP_MEMBER_ROLE_ADMIN, new V2TIMCallback() {@Overridepublic void onSuccess() {// 更改群成员角色成功}@Overridepublic void onError(int code, String desc) {// 更改群成员角色失败}});V2TIMManager.getInstance().addGroupListener(new V2TIMGroupListener() {@Overridepublic void onGrantAdministrator(String groupID, V2TIMGroupMemberInfo opUser,List<V2TIMGroupMemberInfo> memberList) {// 被设置管理员通知}@Overridepublic void onRevokeAdministrator(String groupID, V2TIMGroupMemberInfo opUser,List<V2TIMGroupMemberInfo> memberList) {// 被取消管理员通知}});
[[V2TIMManager sharedInstance] setGroupMemberRole:@"groupA" member:@"user1" newRole:V2TIM_GROUP_MEMBER_ROLE_ADMIN succ:^{// 更改群成员角色成功} fail:^(int code, NSString *desc) {// 更改群成员角色失败}];[[V2TIMManager sharedInstance] addGroupListener:self];- (void)onGrantAdministrator:(NSString *)groupID opUser:(V2TIMGroupMemberInfo *)opUser memberList:(NSArray <V2TIMGroupMemberInfo *> *)memberList {// 被设置管理员通知}- (void)onRevokeAdministrator:(NSString *)groupID opUser:(V2TIMGroupMemberInfo *)opUser memberList:(NSArray <V2TIMGroupMemberInfo *> *)memberList {// 被取消管理员通知}
class Callback final : public V2TIMCallback {public:using SuccessCallback = std::function<void()>;using ErrorCallback = std::function<void(int, const V2TIMString&)>;Callback() = default;~Callback() override = default;void SetCallback(SuccessCallback success_callback, ErrorCallback error_callback) {success_callback_ = std::move(success_callback);error_callback_ = std::move(error_callback);}void OnSuccess() override {if (success_callback_) {success_callback_();}}void OnError(int error_code, const V2TIMString& error_message) override {if (error_callback_) {error_callback_(error_code, error_message);}}private:SuccessCallback success_callback_;ErrorCallback error_callback_;};V2TIMString groupID = "groupA";V2TIMString userID = "userB";uint32_t role = V2TIMGroupMemberRole::V2TIM_GROUP_MEMBER_ROLE_ADMIN;auto callback = new Callback;callback->SetCallback([=]() {// 更改群成员角色成功delete callback;},[=](int error_code, const V2TIMString& error_message) {// 更改群成员角色失败delete callback;});V2TIMManager::GetInstance()->GetGroupManager()->SetGroupMemberRole(groupID, userID, role, callback);// 监听被设置管理员通知class GroupListener final : public V2TIMGroupListener {public:GroupListener() = default;~GroupListener() override = default;void OnGrantAdministrator(const V2TIMString& groupID, const V2TIMGroupMemberInfo& opUser,const V2TIMGroupMemberInfoVector& memberList) override {// 被设置管理员通知}void OnRevokeAdministrator(const V2TIMString& groupID, const V2TIMGroupMemberInfo& opUser,const V2TIMGroupMemberInfoVector& memberList) override {// 被取消管理员通知}// 其他成员 ...};// 添加群事件监听器,注意在移除监听器之前需要保持 groupListener 的生命期,以免接收不到事件回调GroupListener groupListener;V2TIMManager::GetInstance()->AddGroupListener(&groupListener);
onGroupInfoChanged
(Android / iOS & Mac / Windows) 回调,其中 V2TIMGroupChangeInfo
的 type
为 V2TIMGroupChangeInfo.V2TIM_GROUP_INFO_CHANGE_TYPE_OWNER
,值为新群主的 UserID
。V2TIMManager.getGroupManager().transferGroupOwner("groupA", "userB", new V2TIMCallback() {@Overridepublic void onSuccess() {// 转让群主成功}@Overridepublic void onError(int code, String desc) {// 转让群主失败}});
[[V2TIMManager sharedInstance] transferGroupOwner:@"groupA" member:@"user1" succ:^{// 转让群主成功} fail:^(int code, NSString *desc) {// 转让群主失败}];
class Callback final : public V2TIMCallback {public:using SuccessCallback = std::function<void()>;using ErrorCallback = std::function<void(int, const V2TIMString&)>;Callback() = default;~Callback() override = default;void SetCallback(SuccessCallback success_callback, ErrorCallback error_callback) {success_callback_ = std::move(success_callback);error_callback_ = std::move(error_callback);}void OnSuccess() override {if (success_callback_) {success_callback_();}}void OnError(int error_code, const V2TIMString& error_message) override {if (error_callback_) {error_callback_(error_code, error_message);}}private:SuccessCallback success_callback_;ErrorCallback error_callback_;};V2TIMString groupID = "groupA";V2TIMString userID = "userB";auto callback = new Callback;callback->SetCallback([=]() {// 转让群主成功delete callback;},[=](int error_code, const V2TIMString& error_message) {// 转让群主失败delete callback;});V2TIMManager::GetInstance()->GetGroupManager()->TransferGroupOwner(groupID, userID, callback);
V2TIMManager.getGroupManager().getGroupOnlineMemberCount("group_avchatroom", new V2TIMValueCallback<Integer>() {@Overridepublic void onSuccess(Integer integer) {// 获取直播群在线人数成功}@Overridepublic void onError(int code, String desc) {// 获取直播群在线人数失败}});
[[V2TIMManager sharedInstance] getGroupOnlineMemberCount:@"group_avchatroom" succ:^(NSInteger count) {// 获取直播群在线人数成功} fail:^(int code, NSString *desc) {// 获取直播群在线人数失败}];
template <class T>class ValueCallback final : public V2TIMValueCallback<T> {public:using SuccessCallback = std::function<void(const T&)>;using ErrorCallback = std::function<void(int, const V2TIMString&)>;ValueCallback() = default;~ValueCallback() override = default;void SetCallback(SuccessCallback success_callback, ErrorCallback error_callback) {success_callback_ = std::move(success_callback);error_callback_ = std::move(error_callback);}void OnSuccess(const T& value) override {if (success_callback_) {success_callback_(value);}}void OnError(int error_code, const V2TIMString& error_message) override {if (error_callback_) {error_callback_(error_code, error_message);}}private:SuccessCallback success_callback_;ErrorCallback error_callback_;};V2TIMString groupID = "group_avchatroom";auto callback = new ValueCallback<uint32_t>{};callback->SetCallback([=](const uint32_t& count) {// 获取直播群在线人数成功delete callback;},[=](int error_code, const V2TIMString& error_message) {// 获取直播群在线人数失败delete callback;});V2TIMManager::GetInstance()->GetGroupManager()->GetGroupOnlineMemberCount(groupID, callback);
本页内容是否解决了您的问题?