Session

interface Session

This interface defines interactions with a session. An instance of a session will be provided by the SDK.

Types

Link copied to clipboard

A global session listener to get notified for some events.

Functions

Link copied to clipboard

Returns the account data service associated with the session.

Link copied to clipboard

Returns the AccountService associated with the session.

Link copied to clipboard
abstract fun addListener(listener: Session.Listener)

Add a listener to the session.

Link copied to clipboard

Returns the call signaling service associated with the session.

Link copied to clipboard
abstract suspend fun clearCache()

Clear cache of the session.

Link copied to clipboard
abstract fun close()

This method allow to close a session. It does stop some services.

Link copied to clipboard

Returns the ContentDownloadStateTracker associated with the session.

Link copied to clipboard

Returns the ContentScannerService associated with the session.

Link copied to clipboard

Returns the ContentUploadProgressTracker associated with the session.

Link copied to clipboard

Returns the ContentUrlResolver associated to the session.

Link copied to clipboard

Returns the cryptoService associated with the session.

Link copied to clipboard
abstract fun eventService(): EventService

Returns the EventService associated with the session.

Link copied to clipboard

Returns the EventStreamService associated with the session.

Link copied to clipboard

Returns the federation service associated with the session.

Link copied to clipboard
abstract fun fileService(): FileService

Returns the file download service associated with the session.

Link copied to clipboard
abstract fun getAuthenticatedOkHttpClient(): OkHttpClient

Same as getOkHttpClient but will add the access token to the request.

Link copied to clipboard
abstract fun getDbUsageInfo(): String

Debug API, will return info about the DB.

Link copied to clipboard
abstract fun getOkHttpClient(): OkHttpClient

Will return a OkHttpClient which will manage pinned certificates and Proxy if configured. It will not add any access-token to the request. So it is exposed to let the app be able to download image with Glide or any other libraries which accept an OkHttp client.

Link copied to clipboard
abstract fun getRealmConfigurations(): List<RealmConfiguration>

Debug API, return the list of all RealmConfiguration used by this session.

Link copied to clipboard
fun Session.getRoom(roomId: String): Room?

Get a room using the RoomService of a Session.

Link copied to clipboard

Get a room summary using the RoomService of a Session.

Link copied to clipboard
abstract fun getUiaSsoFallbackUrl(authenticationSessionId: String): String
Link copied to clipboard
fun Session.getUser(userId: String): User?

Get a user using the UserService of a Session.

Link copied to clipboard

Similar to getUser, but fallback to a User without details if the User is not known by the SDK, or if Session is null.

Link copied to clipboard

Returns the HomeServerCapabilities service associated with the session.

Link copied to clipboard

Returns the identity service associated with the session.

Link copied to clipboard

Returns the integration manager service associated with the session.

Link copied to clipboard
abstract fun mediaService(): MediaService

Returns the media service associated with the session.

Link copied to clipboard
abstract fun open()

This method allow to open a session. It does start some service on the background.

Link copied to clipboard

Returns the open id service associated with the session.

Link copied to clipboard

Returns the permalink service associated with the session.

Link copied to clipboard

Returns the PresenceService associated with the session.

Link copied to clipboard

Returns the ProfileService associated with the session.

Link copied to clipboard

Returns the PushersService associated with the session.

Link copied to clipboard

Returns the PushRuleService associated with the session.

Link copied to clipboard
abstract fun removeListener(listener: Session.Listener)

Remove a listener from the session.

Link copied to clipboard

Returns the RoomDirectoryService associated with the session.

Link copied to clipboard
abstract fun roomService(): RoomService

Returns the RoomService associated with the session.

Link copied to clipboard

Returns the search service associated with the session.

Link copied to clipboard

Returns the SharedSecretStorageService associated with the session.

Link copied to clipboard

Returns the SignOutService associated with the session.

Link copied to clipboard
abstract fun spaceService(): SpaceService

Returns the space service associated with the session.

Link copied to clipboard
abstract fun syncService(): SyncService

Returns the SyncService associated with the session.

Link copied to clipboard
abstract fun termsService(): TermsService

Returns the TermsService associated with the session.

Link copied to clipboard

Returns the third party service associated with the session.

Link copied to clipboard

Returns the ToDeviceService associated with the session.

Link copied to clipboard

Returns the TypingUsersTracker associated with the session.

Link copied to clipboard
abstract fun userService(): UserService

Returns the UserService associated with the session.

Link copied to clipboard

Returns the widget service associated with the session.

Properties

Link copied to clipboard
abstract val isOpenable: Boolean

The session is valid, i.e. it has a valid token so far.

Link copied to clipboard
open val myUserId: String

Useful shortcut to get access to the userId.

Link copied to clipboard
abstract val sessionId: String

The sessionId.

Link copied to clipboard

The params associated to the session.