STWContactApi

object STWContactApi : ObservableApi

Functions

Link copied to clipboard
fun addContact(    context: Context,     contactIdentifier: String,     callback: (ApiResult<Boolean>) -> Unit?)

Call this function to add new subscriber in contact list

Link copied to clipboard
suspend fun addSuspendedContact(context: Context, contactIdentifier: String): ApiResult<Boolean>

Call this function to add new subscriber in contact list

Link copied to clipboard
fun addToFavorite(context: Context, contact: STWContact)

Add the given contact to the favorite list This method works asynchronously and will synchronize the favorite list with other accounts of User (Like webchat)

Link copied to clipboard
fun enableReverseContactNameDisplay(context: Context, enabled: Boolean)

This method is used to enable/disable reverse display of contact name -Option enabled : contact name will be displayed like , FirstName> -Option disabled : contact name will be displayed like , LastName>

Link copied to clipboard
fun getAllCompanyContactsAsLiveData(context: Context): LiveData<List<STWContact>?>

Get only visible company contacts (users & groups)

Link copied to clipboard
suspend fun getAllContacts(    context: Context,     @IntRange(from = 0) from: Int? = null,     @IntRange(from = 1) pageSize: Int? = null): List<STWContact>?

Get All contacts (visible company contacts, all SmartMs and non SmartMS contacts)

Link copied to clipboard
fun getAllContactsAsLiveData(context: Context): LiveData<List<STWContact>?>
fun getAllContactsAsLiveData(context: Context, search: String? = null): LiveData<List<STWContact>?>

Get All contacts (visible company contacts, all SmartMs and non SmartMS contacts)

Link copied to clipboard
fun getAllContactsAsPagingSource(context: Context): PagingSource<Int, STWContact>

Get paged contacts (visible company contacts, all SmartMs and non SmartMS contacts)

Link copied to clipboard
suspend fun getAllContactsWithPhoneSearch(    context: Context,     search: String?,     @IntRange(from = 0) from: Int,     @IntRange(from = 1) pageSize: Int): List<STWSingleContact>?

Get a list of single contact having international phone number that contains a search keyword

Link copied to clipboard
fun getAllContactsWithPhoneSearchAsLiveData(context: Context, search: String? = null): LiveData<List<STWSingleContact>?>

Get a list of single contact having international phone number that contains a search keyword

Link copied to clipboard
fun getAllowedFeaturesAsFlow(    featureName: String,     coroutineScope: CoroutineScope,     lifecycleOwner: LifecycleOwner): StateFlow<Boolean>
fun getAllowedFeaturesAsFlow(    featureName: String,     coroutineScope: CoroutineScope,     getDisposable: (disposable: Disposable) -> Unit): StateFlow<Boolean>

Call this method to check whether the contact feature is allowed or not.

Link copied to clipboard
fun getCompanyContactsAsFlow(context: Context, filter: Int = STWContactFilterOption.ORGANIZATION.DEFAULT): Flow<List<STWContact>?>

Get only visible company contacts given filter

Link copied to clipboard
fun getCompanyContactsAsLiveData(context: Context, filter: Int = STWContactFilterOption.ORGANIZATION.DEFAULT): LiveData<List<STWContact>?>

Get only visible company contacts given filter

Link copied to clipboard
suspend fun getCompanyContactsByFilter(    context: Context,     contactFilterOption: STWContactFilterOption? = null,     @IntRange(from = 0) from: Int? = null,     @IntRange(from = 1) pageSize: Int? = null): List<STWContact>?

Get only visible company contacts given contactFilterOption

suspend fun getCompanyContactsByFilter(    context: Context,     filter: Int = STWContactFilterOption.ORGANIZATION.DEFAULT,     @IntRange(from = 0) from: Int? = null,     @IntRange(from = 1) pageSize: Int? = null): List<STWContact>?

Get company contacts

Link copied to clipboard
fun getCompanyContactsByFilterAsPagingSource(context: Context, filter: Int = STWContactFilterOption.ORGANIZATION.DEFAULT): PagingSource<Int, STWContact>

Get company contacts

Link copied to clipboard
fun getCompanyGroupsAsLiveData(context: Context): LiveData<List<STWContact>?>

Get only visible company groups

Link copied to clipboard
fun getCompanyUsersAsLiveData(context: Context): LiveData<List<STWContact>?>

Get only visible company users

Link copied to clipboard
fun getContactByGroupId(context: Context, groupId: Long): STWGroup?

Get -if exist- the STWGroup having the specified group Id

Link copied to clipboard
fun getContactByGroupName(context: Context, groupName: String): STWGroup?

Get the group contact having the specified groupName

Link copied to clipboard
fun getContactById(context: Context, contactId: Int): STWContact?

Get -if exist- the STWContact having the specified contact Id

Link copied to clipboard
fun getContactByInternationalPhoneNumber(context: Context, internationalNumber: String): STWSingleContact?

Get -if exist- the STWSingleContact having the specified international number

fun getContactByInternationalPhoneNumberAsFlow(Context: Context, internationalNumber: String): Flow<STWSingleContact?>?

Get -if exist- the STWSingleContact as Flow having the specified international number

fun getContactListByInternationalPhoneNumbersAsFlow(context: Context, internationalNumberList: List<String>): Flow<List<STWSingleContact>>?

Get list of contact as flow by their international phone number

Link copied to clipboard
suspend fun getContactMembersOfGroup(context: Context, groupId: Long): List<STWContact>?

Get the list of :

Link copied to clipboard
suspend fun getContacts(    context: Context,     phoneNumbers: List<String>,     @IntRange(from = 0) from: Int,     @IntRange(from = 1) pageSize: Int): List<STWSingleContact>?

Get contacts list based on the phone number list

Link copied to clipboard
fun getDefaultFilterOperationalStatus(context: Context): String?

Get default Operational Status Filters

Link copied to clipboard
suspend fun getFavoriteContacts(context: Context): List<STWContact>?

Gets the list of favorite contacts.

Link copied to clipboard
fun getFavoriteContactsAsLiveData(context: Context): LiveData<List<STWContact>?>

Gets the list of favorite contacts as LiveData.

Link copied to clipboard
fun getFilteredCompanyContactsAsFlow(context: Context, contactFilterOption: STWContactFilterOption? = null): Flow<List<STWContact>?>

Get only visible company contacts given contactFilterOption

fun getFilteredCompanyContactsAsFlow(    context: Context,     contactFilterOption: STWContactFilterOption? = null,     searchContent: String?): Flow<List<STWContact>?>

Call this method to synchronize local contacts given contactFilterOption and search contact

Link copied to clipboard
fun getFilteredCompanyContactsAsLiveData(context: Context, contactFilterOption: STWContactFilterOption? = null): LiveData<List<STWContact>?>

Get only visible company contacts given contactFilterOption

Link copied to clipboard
fun getGroupByIdAsLiveData(context: Context, groupId: Long): LiveData<STWContact>

Get -if exist- the STWContact having the specified group Id

Link copied to clipboard
suspend fun getGroupDetails(    context: Context,     groupId: Long,     callback: ContactOperationCallback<List<STWContact>?>?)

Suspend method used to get a group by groupId and request updates from the remote if the group last fetch date is old

Link copied to clipboard
fun getGroupDetailsByGroupIdAsLiveData(context: Context, groupId: Long): LiveData<STWGroup?>

Call this method to get group details as live data

Link copied to clipboard
fun getGroupMembersAsLiveData(context: Context, groupId: Long): LiveData<List<STWContact>?>

Call this method to get group members as live data

Link copied to clipboard
suspend fun getGroupRemoteUpdate(    context: Context,     groupId: Long,     forceUpdate: Boolean = false): ApiResult<STWGroupDetails>

Call this method to get update for the given grou id this method should get details from remote server, then update the local database

Link copied to clipboard
suspend fun getGroupsByGroupIds(context: Context, groupIds: List<String>?): List<STWGroup>?

Get the list of STWGroup

Link copied to clipboard
suspend fun getGroupsForSubscriber(context: Context, systemContactId: Long): List<STWGroup>?

Get the list of groups in which the current subscriber is member

Link copied to clipboard
fun getMyContact(context: Context): STWSubscriber?
Link copied to clipboard
suspend fun getMyContactSuspended(context: Context): STWSubscriber?

Get the current logged user

Link copied to clipboard
suspend fun getNonSmartMSContacts(    context: Context,     search: String? = null,     @IntRange(from = 0) from: Int? = null,     @IntRange(from = 1) pageSize: Int? = null): List<STWContact>?

Get non SmartMS contacts (system contacts)

Link copied to clipboard
fun getNonSmartMSContactsAsFlow(context: Context, search: String? = null): Flow<List<STWContact>?>
Link copied to clipboard
fun getNonSmartMSContactsAsLiveData(context: Context): LiveData<List<STWContact>?>

Get non SmartMS contacts (system contacts)

fun getNonSmartMSContactsAsLiveData(context: Context, search: String? = null): LiveData<List<STWContact>?>
Link copied to clipboard
fun getOperationalStatusByIdentifier(context: Context, identifier: Int): OperationalStatusItem?

Get operational status related to specified identifier

Link copied to clipboard
fun getOperationalStatusList(context: Context): List<OperationalStatusItem?>?

Get the operational status list

Link copied to clipboard
fun getRoleIconByPhone(context: Context, phone: STWPhone): RoleIconItem?

Get the role icon for a specific PhoneItem

Link copied to clipboard
fun getRoleIconPicture(roleIconId: Int): Bitmap?

Get the role icon picture for the a specific roleIconId.

Link copied to clipboard
suspend fun getSmartMSContacts(context: Context): List<STWContact>?
suspend fun getSmartMSContacts(    context: Context,     search: String? = null,     @IntRange(from = 0) from: Int? = null,     @IntRange(from = 1) pageSize: Int? = null): List<STWContact>?

Get All contacts from other departments, other companies and other SmartMs Apps witch are synced with local contacts

Link copied to clipboard
fun getSmartMSContactsAsFlow(context: Context, search: String? = null): Flow<List<STWContact>?>

Get All contacts from other departments, other companies and other SmartMs Apps witch are synced with local contacts

Link copied to clipboard
fun getSmartMSContactsAsLiveData(context: Context): LiveData<List<STWContact>?>
fun getSmartMSContactsAsLiveData(context: Context, search: String? = null): LiveData<List<STWContact>?>

Get All contacts from other departments, other companies and other SmartMs Apps witch are synced with local contacts

Link copied to clipboard
fun getSmartMsPhoneByContact(context: Context, systemContactId: Long): STWPhone?

Get the SmartMs STWPhone related to the specified contact. This method is useful only for single contacts.

Link copied to clipboard
fun getSubscriberConnectionStatus(    lifecycle: Lifecycle,     phoneNumber: String,     subscriberConnectionStatusCallback: (ApiResult<Boolean>) -> Unit?)

Load the contact connection status linked to Technical disconnect feature

Link copied to clipboard
fun getSubscriberDetailsByNumber(context: Context, internationalNumber: String): LiveData<STWSubscriberDetails?>

Call this method to get subscriber details as live data from Local Database

Link copied to clipboard
suspend fun getSubscriberRemoteUpdate(    context: Context,     internationalNumber: String,     forceUpdate: Boolean = false): ApiResult<STWSubscriberDetails>

Call this method to get update for the given subscriber this method should get details from remote server, then update the local database

Link copied to clipboard
suspend fun getSubscribersAndSubGroups(    context: Context,     contactIds: List<String>?,     groupIds: List<String>?): List<STWContact>?

Get the list of STWContact

Link copied to clipboard
suspend fun getSuspendGroupDetailsByGroupId(context: Context, groupId: Long): ApiResult<STWGroupDetails>

Call this method to get group details (Suspend way)

Link copied to clipboard
suspend fun getSuspendSubscriberDetailsByPhoneNumber(context: Context, internationalPhoneNumber: String): ApiResult<STWSubscriberDetails>

Call this function to get subscriber detail from Local Database as suspended method

Link copied to clipboard
fun getUserPhone(context: Context): STWPhone?

Get the STWPhone corresponding to the current user account

Link copied to clipboard
suspend fun inviteGuest(    context: Context,     phoneNumber: String,     firstName: String,     lastName: String,     email: String? = null,     details: String? = null,     stwContactList: List<STWContact>? = null,     sendMethod: Int): ApiResult<STWContact?>

Call this method to invite a Guest

Link copied to clipboard
fun isDefaultFilterForAllUsersAllowed(context: Context): Boolean

Whether the default filter for all users allowed or not

Link copied to clipboard
fun isDisplayDisconnectedUsersAllowed(context: Context): Boolean

Call this method to check whether the display of disconnected users feature is allowed or not.

Link copied to clipboard
fun isExternalUserIncorporationAllowed(context: Context): Boolean

Call this method to check whether the external user incorporation feature is allowed or not.

Link copied to clipboard
fun isExternalUserInvitationAllowed(context: Context): Boolean

Call this method to check whether the external user invitation feature is allowed or not.

Link copied to clipboard
fun isIconPerRoleFeatureAllowed(context: Context): Boolean

Check whether the IconPerRole feature is enabled.

Link copied to clipboard
fun isOnOffDutyAvailable(context: Context): Boolean

In some organizations and for performance reasons the server may not return the user availability (on/off duty) for all subscribers. The value can only be retrieved when requesting for subscriber's details

Link copied to clipboard
fun isOperationalStatusAvailable(context: Context): Boolean

In some organizations and for performance reasons the server may not return the operational status for all users. The value can only be retrieved when requesting for subscriber's details

Link copied to clipboard
fun isProbeSubscriber(context: Context): Boolean

Call this function to check if i'm subscribe in the PROBE TEST.

Link copied to clipboard
fun isPublicVisibilityAllowed(context: Context): Boolean

Call this method to check whether the Public visibility can be changed on user settings or not

Link copied to clipboard
fun isPublicVisibilityEnabled(context: Context): Boolean

Call this method to check if the Public Visibility is enabled or not

Link copied to clipboard
fun isReverseContactNameDisplayEnabled(context: Context): Boolean

Check if reverse contact name option is enabled.

Link copied to clipboard
fun isUserAliasAllowed(context: Context): Boolean

Call this method to check whether the user alias feature is allowed or not.

Link copied to clipboard
fun isUserAliasModificationAllowed(context: Context): Boolean

Call this method to check whether the user alias settings can be modified by the client or not.

Link copied to clipboard
fun refreshSystemContacts()

Call this method to force updated of system contacts

Link copied to clipboard
fun removeContact(    context: Context,     contactIdentifier: String,     callback: (ApiResult<Boolean>) -> Unit?)

Call this function to remove contact from the contact list The contact can only be a subscriber

Link copied to clipboard
fun removeFromFavorite(context: Context, contact: STWContact)

remove the given contact from the favorite list This method works asynchronously and will synchronize the favorite list with other accounts of User (Like webchat)

Link copied to clipboard
suspend fun removeSuspendedContact(context: Context, contactIdentifier: String): ApiResult<Boolean>

Call this function to remove contact from the contact list

Link copied to clipboard
suspend fun searchCompanyContacts(    context: Context,     filterOption: STWContactFilterOption? = null,     search: String? = null,     @IntRange(from = 0) from: Int? = null,     @IntRange(from = 1, to = 50) pageSize: Int? = null): List<STWContact>?

Call this method to search for contacts. A request will be send to server from the local database to retrieve searched contacts and merged with local contacts

Link copied to clipboard
fun searchCompanyContactsAsFlow(    context: Context,     filterOption: STWContactFilterOption? = null,     search: String? = null): Flow<List<STWContact>?>

This method will first emit the filtered Company contacts from the local database and then request the filtered company contacts from the remote server, it will then emit the result as soon as it is received.

Link copied to clipboard
fun searchCompanyContactsAsPagingSource(    context: Context,     filter: STWContactFilterOption? = null,     search: String? = null): PagingSource<Int, STWContact>

Call this method to search for contacts. A request will be send to server from the local database to retrieve searched contacts and merged with local contacts The max number of contacts to be retrieved should be >= 1 and <=50.

Link copied to clipboard
fun setUserPublicVisibility(publicVisibility: Boolean, callback: (ApiResult<Any?>) -> Unit??)

Call this method to change the user Public Visibility

Link copied to clipboard
fun syncSystemContacts()

Call this method to synchronize local contacts with server to get contacts that exist in the phone address book, and then contacts will be updated automatically every 10 minutes

Link copied to clipboard
fun updateFavoriteList(    context: Context,     contacts: <ERROR CLASS><STWContact>,     callback: (ApiResult<Any>) -> Unit?? = null)

Update the favorite contacts list to the given list This method works asynchronously and will synchronize the favorite list with other accounts of User (Like webchat)

Inherited functions

Link copied to clipboard
fun subscribe(listener: STWEventListener<STWEvent>): Disposable
Link copied to clipboard
fun subscribeFor(eventTypes: Array<Class<out STWEvent>>, listener: STWEventListener<STWEvent>): Disposable
fun subscribeFor(eventTypes: Array<String>, listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client.

fun subscribeFor(    lifecycleOwner: LifecycleOwner,     eventTypes: Array<Class<out STWEvent>>,     listener: STWEventListener<STWEvent>): Disposable
fun subscribeFor(    lifecycleOwner: LifecycleOwner,     eventTypes: Array<String>,     listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client, in the lifecycle of lifecycleOwner.

fun subscribeFor(    eventTypes: Array<String>,     filter: (STWEvent) -> Boolean,     listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client with additional filter.

fun subscribeFor(    lifecycleOwner: LifecycleOwner,     eventTypes: Array<String>,     filter: (STWEvent) -> Boolean,     listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client with additional filter, in the lifecycle of lifecycleOwner.

Link copied to clipboard
fun <T : STWEvent> subscribeForSingle(eventType: Class<T>, listener: STWEventListener<T>): Disposable
fun subscribeForSingle(eventType: String, listener: STWEventListener<STWEvent>): Disposable

Subscribes for the next event with the given eventType.

fun subscribeForSingle(    eventType: String,     filter: (STWEvent) -> Boolean,     listener: STWEventListener<STWEvent>): Disposable

Subscribes for the next event with the given eventType with additional filter.