# SessionsRx

class SessionsRx

Reactive API of Sessions.

This class exposes the session state included in Sessions but using a Rx observable.

## Types

Companion
Link copied to clipboard
object Companion

## Properties

state
Link copied to clipboard
val state: Observable<Session.State>

Emits the session state whenever it changes. When a subscriber is added, it will also emit the current session state.

## Functions

enableDoNotDisturb
Link copied to clipboard
fun enableDoNotDisturb(context: Context, isEnabled: Boolean): Completable

Enables/Disables the Do-Not-Disturb option. When activated, disables the current Firebase token to avoid receiving push notifications from the server and blocks incoming calls received through socket.

fetchAuthProvider
Link copied to clipboard
fun fetchAuthProvider(): Single<AuthProvider>

Fetches the available AuthProvider.

getLocalUser
Link copied to clipboard
fun getLocalUser(): Single<WacUser>

Retrieves the information of the local user.

getSessionId
Link copied to clipboard
fun getSessionId(): Maybe<String>

Retrieves the session identifier in the signaling server if it has been established.

updateLocalUser
Link copied to clipboard
fun updateLocalUser(user: WacUser): Single<WacUser>

Updates the local user.

waitUntilSessionAndQssConnected
Link copied to clipboard
fun waitUntilSessionAndQssConnected(timeoutSeconds: Long = 10): Completable