prepare

fun prepare(context: Context, newConfig: SocketFactoryConfiguration? = null)

Reestablish a chat connection if one does not currently exist.

Parameters

context

Application context for resource access.

newConfig

Optional configuration which will be used to prepare Chat instance. If supplied, it will take precedence over previously set configuration.

Throws

if the connection is not in the initial state, i.e.:

  • it has already been prepared or connected;

  • the ChatInstanceProvider was not provided with a configuration at creation time.