Start session

Initialisation through ComapiChat class gives you access to client object used for any further communication with the SDK. See Initialise for details.

In order to communicate with Comapi services you need to start session in SDK. This is needed only once per user log in, after that SDK will be re-authenticating session until you end session.


To register or log in user to Comapi services use

client.service().session().startSession(new Callback<Session>(){/* implement */});
   .subscribe(new Observer<Session>(){/* implement */});

This will ask ComapiAuthenticator (provided in ChatConfig) for a JWT token then SDK will create session server side for profile id obtained from the token. Any subsequent call to services will use same authentication details.


To close currently opened session use

   new Callback<ComapiResult<Void>>(){/* implement */});


   .subscribe(new Observer<ComapiResult<Void>>(){/* implement */});