sippo-sdk / com.quobis.sippo.sipposdk.presence / Presences

Presences

class Presences

The presence service.

This class allows performing presence related actions like obtaining the local user presence or subscribing to the presence of one or more contacts. It also allows adding a listener to receive presence events (@see PresencesListener).

Properties

rx

val rx: PresencesRx

Access to the reactive API of the service.

Functions

addListener

fun addListener(listener: PresencesListener): Unit

Adds a listener to receive presence events.

getOwnPresence

fun getOwnPresence(onCompletion: (Either<Presence, SippoResourceError>) -> Unit): Unit

Fetches the presence for the current user.

getPresenceForContact

fun getPresenceForContact(contact: Contact, onCompletion: (Either<Presence?, SippoResourceError>) -> Unit): Unit

Fetches the presence for the specified contact.

getPresences

fun getPresences(withoutAvatar: Boolean, onCompletion: (Either<List<Presence>, SippoResourceError>) -> Unit): Unit

Fetches all the presences to which the current user is subscribed.

removeListener

fun removeListener(listener: PresencesListener): Unit

Removes the specified listener.

subscribeToPresence

fun subscribeToPresence(contact: Contact, onCompletion: (Either<Presence?, SippoResourceError>) -> Unit): Unit

Subscribes to the presence of the specified contact.

subscribeToPresences

fun subscribeToPresences(contacts: List<Contact>, onCompletion: (Either<List<Presence>, SippoResourceError>) -> Unit): Unit

Subscribes to the presence of each contact included in contacts.

updateOwnPresence

fun updateOwnPresence(presence: Presence, onCompletion: (Either<Presence, SippoResourceError>) -> Unit): Unit

Updates the presence for the current user.