STWEmergencyApi

object STWEmergencyApi : ObservableApi

STWEmergencyApi

Description:

Class responsible to manage all emergency alerts

 

This class offers several possible operations defined in the following list:

  • Check if raise channel to emergency mode is allowed
  • When raise channel feature is allowed, check if user can raise the channel to emergency mode
  • Check if the current user is the initiator of raise channel to emergency mode
  • Check if exist raised channel by the current user

 

Check if raise channel to emergency mode is allowed

 

{@code
.......
STWEmergencyApi.isActiveChannelEmergencyCallType()

........ }

 

When raise channel feature is allowed, check if user can raise the channel to emergency mode

 

{@code
.......
STWEmergencyApi.canRaiseChannelToEmergencyMode(context)

........ }

 

Check if the current user is the initiator of raise channel to emergency mode

 

{@code
.......
STWEmergencyApi.iAmChannelEmergencyInitiator(context,stwPTTCall)

........ }

 

Check if exist raised channel by the current user

 

{@code
.......
STWEmergencyApi.isExistRaisedChannelByCurrentUser(context)

........ }

Functions

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

Call this method to check if can raise channel to emergency mode :

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 emergency feature is allowed or not.

Link copied to clipboard
fun iAmChannelEmergencyInitiator(context: Context, call: STWPTTCall): Boolean

Call this methode to check if the current user is the initiator of emergency in channel (who raised the channel to Emergency Mode)

Link copied to clipboard
fun isActiveChannelEmergencyCallType(): Boolean

Check if emergency call type is "active channel" callType = 2

Link copied to clipboard
fun isAlertModeOn(conversation: STWConversation): Boolean

Check if the specified conversation is in alert mode

Link copied to clipboard
fun isEmergencyAmbientListeningAllowed(): Boolean

Check whether the EmergencyAmbientListening feature is enabled or not.

fun isEmergencyAmbientListeningShowConversation(): Boolean

Check if the EmergencyAmbientListening Conversation need to show or no

Link copied to clipboard
fun isEmergencyCallAllowed(): Boolean

Check whether the EmergencyCall feature is enabled or not.

Link copied to clipboard
fun isEmergencyMessageAllowed(): Boolean

Check whether the EmergencyMessage feature is enabled or not.

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

Call this method to check if exist a channel raised to emergency mode by the current user

Link copied to clipboard
suspend fun startEmergencyAmbientListeningCall(    context: Context,     conversationName: String?,     callPriority: Int): ApiResult<STWVCall>

Call this method to start a new Emergency Ambient Listening call with preconfigured recipients

Link copied to clipboard
suspend fun startEmergencyCall(    context: Context,     conversationName: String?,     floorRequestOnInvite: Boolean = false,     callPriority: Int,     onEmergencyFallback: FallbackCallback? = null): ApiResult<STWVCall>

Call this method to start a new Emergency PTT call with preconfigured recipients

suspend fun startEmergencyCallWithAdditionalRecipients(    context: Context,     additionalRecipients: List<STWRecipient>,     conversationName: String,     floorRequestOnInvite: Boolean = false,     callPriority: Int,     onEmergencyFallback: FallbackCallback? = null): ApiResult<STWVCall>

Call this method to start a new Emergency PTT call with additional recipients besides the pre-configured recipients

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.