inviteUsers method

Future<void> inviteUsers(
  1. List<String> userIds
)

Invites one or more User with given userIds to this channel.

After this method completes successfully, ChannelEventHandler.onUserReceivedInvitation will be invoked on each invited user's end and ChannelEventHandler.onUserJoined can be invoked based on their channel invitation preference which can be set through SendbirdSdk.setChannelInvitationPreference

Implementation

Future<void> inviteUsers(List<String> userIds) async {
  if (userIds.isEmpty) {
    throw InvalidParameterError();
  }

  await _sdk.api.send(GroupChannelInviteRequest(
    userIds: userIds,
    channelUrl: channelUrl,
  ));
}