setup method

Future<void> setup({
  1. required String channelId,
  2. required String userToken,
})

Sets up a connection between SDK and Jivo, by either creating a new session or resuming existing one.

  • channelId is your channel ID in Jivo (same as widget_id);
  • userToken is an unique string that you generate to identify a client, and it determines whether it is necessary to create a new session with a new dialog, or restore an existing one and load the history of the initiated dialog (should be a JWT token).

Implementation

Future<void> setup({required String channelId, required String userToken}) async {
  await _channel.invokeMethod<void>('session:setup', {
      'channel_id': channelId,
      'user_token': userToken
  });
}