I am trying to create a group channel through the following code:
// Code starts here
export async function openOneToOneChannel(user1, user2) {
try {
if (!sb) {
await createSBClient(user1.id);
}
let params = new sb.GroupChannelParams();
params.isPublic = false;
params.isEphemeral = false;
params.isDistinct = true;
params.addUserIds([user1.id, user2.id]);
params.customType = '1-1';
let channel = await sb.GroupChannel.createChannel(params)
return channel;
} catch (error) {
console.log('openOneToOneChannelError', error);
}
}
// Code ends here
The code return channel object successfully but the channel contain only the initiator/sender as a member of the channel. It returns:
…
“joinedMemberCount”:1,
“memberCount”:1,
"members”:[1]
…
rather it should create a channel and add the receiver as a member as well. The correct channel should have:
…
“joinedMemberCount”:2,
“memberCount”:2,
"members”:[2]
…
Can you please let me know what can possibly go wrong here ?
The issue in this instance was specific to the customer, so the resolution would not necessarily be helpful for you. If you DM me your Application ID and an example, I’ll take a look with you.
Maybe it is The problem is, that when I’m trying to create a channel with people who don’t have an account in sendbird, I receive a channel with one person (me) instead of some error or sth. There is no problem, when I’m creating a channel with people who are already connected to sendbird. Is that expected behavior?