restore

fun restore(context: Context)

Restores the active session.

A session is considered active by the server as long as there is an open communication channel with this session, either through a socket connected against the server or by sending push notifications (@see setPushToken to register a valid Firebase token in the server). It should be called when the application comes to foreground if there is enough information to restore the session. The method canRestoreSession should be previously used in order to check this. If the required information is available and the session is still active, it will be restored. In other case, the session state will become Error(reason=RESTORE_NOT_POSSIBLE) and it will be necessary to create a new one (@see connect).

Parameters

context

Application or activity context.