I'm trying to create two group channels with same name but with different users and custom type.` But both the group is not created and when I list the groups. I couldn't find what I have done wrong.
createGroupChannelWithData(workOrderIds, false, "Ticket Id:" + jobId, "", Integer.toString(jobId), "Private_Ticket");
private void createGroupChannelWithData(List<String> userIds, boolean distinct, String name, String coverImage, String data, String ticketType) {
GroupChannel.createChannelWithUserIds(userIds, distinct, name, coverImage, data,
ticketType,
new GroupChannel.GroupChannelCreateHandler() {
@Override
public void onResult(GroupChannel groupChannel, SendBirdException e) {
if (e != null) {
// Error!
return;
}
createGroupChannelWithData1(managementIds, false, "Ticket Id:" + jobId, "", Integer.toString(jobId), "Ticket");
}
});
}
` private void createGroupChannelWithData1(List<String> userIds, boolean distinct, String name, String coverImage, String data, String ticketType) {
GroupChannel.createChannelWithUserIds(userIds, distinct, name, coverImage, data,
ticketType,
new GroupChannel.GroupChannelCreateHandler() {
@Override
public void onResult(GroupChannel groupChannel, SendBirdException e) {
if (e != null) {
// Error!
return;
}
getGroupChannelList("end");
}
});
}
Edit:
Channels are created in Sendbird Dashboard.
But while I list the channels, I get only one channel, with custom type "Ticket". I need to get channel, with custom type "Private_Ticket" also. Everytime, I create two channels, and need the both to list in another app. My code to get the channel list:
GroupChannelListQuery channelListQuery = GroupChannel.createMyGroupChannelListQuery();
channelListQuery.setIncludeEmpty(true);
channelListQuery.setOrder(GroupChannelListQuery.Order.LATEST_LAST_MESSAGE);
// CHRONOLOGICAL, LATEST_LAST_MESSAGE, CHANNEL_NAME_ALPHABETICAL, and METADATA_VALUE_ALPHABETICAL
channelListQuery.setLimit(15);
channelListQuery.next(new GroupChannelListQuery.GroupChannelListQueryResultHandler() {
@Override
public void onResult(List<GroupChannel> list, SendBirdException e) {
if (e != null) { // Error.
return;
}
for (int i = 0; i < list.size(); i++) {
Log.e(" in first loop name : data : custom type >>",list.get(i).getName()+" : "+list.get(i).getData()+" : "+list.get(i).getCustomType());
}
}
});
Edit: The issue is fixed. I haven't include the user of the second app, in list. That's the root cause of the issue. thanks.