hello all
below is a function that gets called in initState:
load() async {
try {
final sendBird = SendbirdSdk(appId: Constants.APP_ID);
final _ = await sendBird.connect(widget.userID);
final query = GroupChannelListQuery()
..limit=1
..userIdsExactlyIn = widget.otherUsers;
List<GroupChannel> channels= await query.loadNext();
GroupChannel aChannel;
var channelUsers=widget.otherUsers+[widget.userID];
if(channels.length==0){
aChannel= await **GroupChannel.createChannel(GroupChannelParams()..userIds=channelUsers);**
print('Channel Created');
}
else{
aChannel = channels[0];
print('existing channel: '+aChannel.name!);
}
List<BaseMessage> messages = await aChannel.getMessagesByTimestamp(DateTime.now().millisecondsSinceEpoch*1000,MessageListParams());
setState(() {
_messages = messages;
_channel= aChannel;
});
} catch (e) {
print(e);
}
}
When I create a channel, I pass it an array of userIds, however it creates a channel with only the logged in user in it
Please let me know what was done wrong and how it can be fixed