fetchSubscribedMembers method
~english Uses pagination to get a list of users whose presence states you have subscribed to.
Param pageNum
The current page number, starting from 1.
Param pageSize
The number of subscribed users on each page.
Return Which contains IDs of users whose presence states you have subscribed to. Returns null if you subscribe to no user's presence state.
Throws A description of the exception. See ChatError. ~end
~chinese 分页查询当前用户订阅了哪些用户的在线状态。
Param pageNum
当前页码,从 1 开始。
Param pageSize
每页显示的被订阅用户数量。
Return 返回订阅的在线状态所属的用户 ID。若当前未订阅任何用户的在线状态,返回空列表。
Throws 如果有方法调用的异常会在这里抛出,可以看到具体错误原因。参见 ChatError。 ~end
Implementation
Future<List<String>> fetchSubscribedMembers({
int pageNum = 1,
int pageSize = 20,
}) async {
Map req = {'pageNum': pageNum, "pageSize": pageSize};
Map result = await _channel.invokeMethod(
ChatMethodKeys.fetchSubscribedMembersWithPageNum, req);
try {
ChatError.hasErrorFromResult(result);
List<String> list = [];
result[ChatMethodKeys.fetchSubscribedMembersWithPageNum]
?.forEach((element) {
if (element is String) {
list.add(element);
}
});
return list;
} on ChatError catch (e) {
throw e;
}
}