Invitation not found Exception in groupChannel.acceptInvitation

Before creating the channel, Our setting is

var autoAccept = true;
sb.setChannelInvitationPreference(autoAccept, function (response, error) {
if (error) {
console.log(error)
return;
}
});

Once channel gets created,

groupChannel.acceptInvitation(function (response, error) {
if (error) {
}
});

is giving error saying "Invitation not found "

Hi @BCH,

Welcome to the Sendbird community!

What you’ve described seems like expected behavior. If you are setting setChannelInvitationPreference to make autoAccept = true, then there is no invitation to accept when you create the channel as it’s already automatically accepted.

Hi @Tyler,

Thank you for your response.

Is anything wrong I m doing, why am I getting the error “Invitation not found” and no message shows up in the channel after this error

Hi again,

You do not need to call acceptInvite if autoAccept is true. Don’t call acceptInvite and you shouldn’t get an error.

If new members get added to the channel after the channel creation, also do we not needed to call invite and accept?

Please confirm @Tyler

You need to invite the users. However, if autoAccept is set to true, which it is in your example, you do NOT need to call accept.

Thank you @Tyler for your clarification.