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
interface Listener : StatisticsListener, SessionLifecycleObserver

A global session listener to get notified for some events.

Functions

Link copied to clipboard
abstract fun accountDataService(): SessionAccountDataService

Returns the account data service associated with the session.

Link copied to clipboard
abstract fun accountService(): AccountService

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
abstract fun callSignalingService(): CallSignalingService

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
abstract fun contentDownloadProgressTracker(): ContentDownloadStateTracker

Returns the ContentDownloadStateTracker associated with the session.

Link copied to clipboard
abstract fun contentScannerService(): ContentScannerService

Returns the ContentScannerService associated with the session.

Link copied to clipboard
abstract fun contentUploadProgressTracker(): ContentUploadStateTracker

Returns the ContentUploadProgressTracker associated with the session.

Link copied to clipboard
abstract fun contentUrlResolver(): ContentUrlResolver

Returns the ContentUrlResolver associated to the session.

Link copied to clipboard
abstract fun cryptoService(): CryptoService

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
abstract fun eventStreamService(): EventStreamService

Returns the EventStreamService associated with the session.

Link copied to clipboard
abstract fun federationService(): FederationService

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 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
abstract fun getUiaSsoFallbackUrl(authenticationSessionId: String): String
Link copied to clipboard
abstract fun homeServerCapabilitiesService(): HomeServerCapabilitiesService

Returns the HomeServerCapabilities service associated with the session.

Link copied to clipboard
abstract fun identityService(): IdentityService

Returns the identity service associated with the session.

Link copied to clipboard
abstract fun integrationManagerService(): IntegrationManagerService

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
abstract fun openIdService(): OpenIdService

Returns the open id service associated with the session.

Link copied to clipboard
abstract fun permalinkService(): PermalinkService

Returns the permalink service associated with the session.

Link copied to clipboard
abstract fun presenceService(): PresenceService

Returns the PresenceService associated with the session.

Link copied to clipboard
abstract fun profileService(): ProfileService

Returns the ProfileService associated with the session.

Link copied to clipboard
abstract fun pushersService(): PushersService

Returns the PushersService associated with the session.

Link copied to clipboard
abstract fun pushRuleService(): PushRuleService

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
abstract fun roomDirectoryService(): RoomDirectoryService

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
abstract fun searchService(): SearchService

Returns the search service associated with the session.

Link copied to clipboard
abstract fun sharedSecretStorageService(): SharedSecretStorageService

Returns the SharedSecretStorageService associated with the session.

Link copied to clipboard
abstract fun signOutService(): SignOutService

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
abstract fun thirdPartyService(): ThirdPartyService

Returns the third party service associated with the session.

Link copied to clipboard
abstract fun toDeviceService(): ToDeviceService

Returns the ToDeviceService associated with the session.

Link copied to clipboard
abstract fun typingUsersTracker(): TypingUsersTracker

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
abstract fun widgetService(): WidgetService

Returns the widget service associated with the session.

Properties

Link copied to clipboard
abstract val coroutineDispatchers: MatrixCoroutineDispatchers
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
abstract val sessionParams: SessionParams

The params associated to the session.

Extensions

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

Get a room using the RoomService of a Session.

Link copied to clipboard
fun Session.getRoomSummary(roomIdOrAlias: String): RoomSummary?

Get a room summary using the RoomService of a Session.

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

Get a user using the UserService of a Session.

Link copied to clipboard
fun Session?.getUserOrDefault(userId: String): User

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