How can I use the iOS Chat SDK (not the UIKit) to view a list of pending channel invitations for the current user (so that I can select to Accept the invitation)?
Hi @srgray,
You can get the channels that the current user is invited with memberStateFilter. You can accept the invitation as well.
1 Like
Thank you for the response. When I apply the memberStateFilter, I do not get the expected results. Here is my scenario:
User1 creates a new channel and only lists User1 as a member via:
let params = SBDGroupChannelParams()
params.name = name
params.isDistinct = true
params.addUserIds([me.rawValue])
params.operatorUserIds = [me.rawValue]
params.channelUrl = "\(userChannelPrefix)\(name)"
Then I invite User2 to the new channel via:
channel.inviteUserId(user2)
But the unexpected results come when I query for channels:
let query = SBDGroupChannel.createMyGroupChannelListQuery()
query?.memberStateFilter = .stateFilterInvitedOnly
My new channel is not returned in that query. But it is returned if I set query?.memberStateFilter = .stateFilterJoinedOnly
Is there anything that could cause that invitation to be “auto-accepted”? I am not calling channel.acceptInvitation()
anywhere.