I’m using SendBird Javascript SDK createMyGroupChannelListQuery()
and the instance’s next()
method to retrieve the list of group channels. However, it will return the list only one time after initialized the instance, the next time it gets called, it result is always an empty array. Since I need to fetch the channels multiple times I need to have the full list of channels always. Please let me know if you have experienced this.
// Retrieve a list of channels
var listQuery = sb.GroupChannel.createMyGroupChannelListQuery();
listQuery.includeEmpty = true;
listQuery.order = 'latest_last_message';
listQuery.limit = 100; // The value of pagination limit could be set up to 100.
if (listQuery.hasNext) {
listQuery.next(function(groupChannels, error) {
if (error) {
// Handle error.
}
// A list of group channels is successfully retrieved.
groupChannels.forEach(channel => {
...
});
...
});
}