STWEmergencyManager

open class STWEmergencyManager
STWEmergencyManager

Class responsible to manage all emergency alerts

 

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

  • Start an emergency alert
  • Start an emergency alert call
  • Stop an emergency alert
  • Acknowledge an emergency alert
  • Check if exist any emergency on

 

Start an emergency alert

 


.......
@STWEmergencyLevel int emergencyLevel = STWEmergencyLevel.EMERGENCY_ALERT_URGENT;
STWEmergencyManager.getInstance().startEmergencyAlert(context, emergencyLevel, new STWEmergencyCompletionCallback() {

     public void onStart(String threadId) {
            //Code...
     }


     public void onError(int errorId) {
            //Code...
     }
});
........

Start an emergency alert call


......
STWEmergencyManager.getInstance().startEmergencyCall(context, new CompletionCallback() {

     public void onCompletion(STWVCall vCall) {
            //Code...
     }


     public void onError(int callFailReason) {
            //Code...
     }
}, new FallbackCallback() {

     public void onFallback(String emergencyAlertNumber) {
            //Start cellular emergency call..
     }
});
......

Stop an emergency alert


.....
STWEmergencyManager.getInstance().stopEmergencyAlert(context, threadId, new STWEmergencyCompletionCallback() {

     public void onStart(String threadId) {
            //Code...
     }


     public void onError(int errorId) {
            //Code...
     }
});
........

Acknowledge an emergency alert


.....
STWEmergencyManager.getInstance().setEmergencyAlertAcknowledged(context, messageId);
........

Check if exist any emergency on


.....
STWEmergencyManager.getInstance().isAlertOn(context, threadId);
........

Check if the automatic floor control for Emergency PTT Call is enabled


.....
STWEmergencyManager.getInstance().isAutomaticFloorControlForEmergencyAllowed();
........

Check if Channel dependant Emergency Call is allowed


.....
STWEmergencyManager.getInstance().isChannelDependantEmergencyAllowed();
........

Start Emergency Call with connected users of active channel

You can use this method to start emergency call with :

  • Single recipients
  • Groups recipients
  • Both
Just you need pass the right recipients param format [groupId:123,groupId:456,21699926249@smartms206.streamwide.com,...]

.....
STWEmergencyManager.getInstance().startEmergencyCallWithConnectedChannel(context,recipients,threadName,priority, completionCallback, fallbackCallback);
........

Check if Channel dependant Emergency Message is allowed


.....
STWEmergencyManager.getInstance().isChannelDependantEmergencyMessageAllowed();
........

Start Emergency Message with connected users of active channel

You can use this method to start emergency message with :

  • Single recipients
  • Groups recipients
  • Both
Just you need pass the right recipients param format [groupId:123,groupId:456,21699926249@smartms206.streamwide.com,...]

.....
STWEmergencyManager.getInstance().startEmergencyAlertWithConnectedChannel(context,recipients,threadName,priority, completionCallback, fallbackCallback);
........

Functions

Link copied to clipboard
open fun getConfiguredEmergencyMessageType(): Int
Get the the configured emergency message type
Link copied to clipboard
open fun getCurrentEmergencyThread(): String
Get the thread in witch the current emergency is triggered
open fun getCurrentThreadIdForReceivedAlertMessage(): String
Use this method to retrieve the current thread id for the received alert message
Link copied to clipboard
open fun getCustomEmergencyMessageDelay(): Long
Get the configured delay before launching a custom emergency message.
Link copied to clipboard
open fun getEmergencyAmbientListeningThreadId(): String
Get the thread in witch the current emergency ambient listening is triggered
Link copied to clipboard
open fun getEmergencyCallFallbackNumber(): String
Get the fallback phone number already written.
Link copied to clipboard
open fun getEmergencyMessageCustomText(): String
Use this method to retrieve emergency message Custom Text
Link copied to clipboard
open fun getEmergencyMessageState(): Int
Get the current state of emergency message
Link copied to clipboard
open fun getInstance(): STWEmergencyManager
Link copied to clipboard
open fun getNumbersInEmergencyState(@NonNull context: Context): List<Pair<String, Integer>>
Get the list of phones in emergency state
Link copied to clipboard
open fun getStartEmergencyMessageInactivityDelay(): Long
Get the configured inactivity delay before launching an emergency message.
Link copied to clipboard
open fun isAlertOn(@NonNull context: Context, @NonNull conversationId: String): Boolean
Check if the specified conversation is in alert mode
open fun isAutomaticFloorControlForEmergencyAllowed(): Boolean
Check if the Automatic floor control feature for emergency PTT call is allowed
Link copied to clipboard
open fun isChannelDependantEmergencyAllowed(): Boolean
Check if the channel Dependant Emergency Call feature is allowed
open fun isChannelDependantEmergencyMessageAllowed(@NonNull context: Context): Boolean
Check if the channel Dependant Emergency Message feature is allowed
Link copied to clipboard
open fun isConversationForEmergency(@NonNull context: Context, @NonNull threadId: String): Boolean
Check if the conversation is for emergency
open fun isConversationForEmergencyAmbientListening(@NonNull context: Context, @NonNull threadId: String): Boolean
Check if the conversation is for emergency Ambient Listening
Link copied to clipboard
open fun isEmergencyAmbientListeningAllowed(@NonNull context: Context): Boolean
Check if the emergency ambient listening feature is allowed
open fun isEmergencyAmbientListeningCallEnabledInCompany(@NonNull context: Context): Boolean
Check if the emergency ambient listening feature is enabled for company level
Link copied to clipboard
open fun isEmergencyCallAllowed(@NonNull context: Context): Boolean
Check if the emergency call feature is allowed
Link copied to clipboard
open fun isEmergencyCallEnabledInCompany(@NonNull context: Context): Boolean
Check if the emergency call feature is enabled for company level
Link copied to clipboard
open fun isEmergencyMessageAllowed(@NonNull context: Context): Boolean
Check if the emergency message feature is allowed
Link copied to clipboard
open fun isPhoneInEmergencyState(@NonNull context: Context, @NonNull phoneItem: String): Boolean
Check if the phoneItem is in emergency alert state
Link copied to clipboard
open fun registerEmergencyListener(@NonNull listener: STWEmergencyListener)
Register the specified listener to be notified by any Emergency State changes
Link copied to clipboard
open fun setEmergencyAlertAcknowledged(    @NonNull context: Context,     @NonNull messageId: String,     @Nullable callback: EmergencyAlertCompletionCallback)
Link copied to clipboard
open fun setLocationCallback(@Nullable locationCallback: LocationCallback)
use setExternalLocationProvider
Link copied to clipboard
open fun startEmergencyAlert(    @NonNull context: Context,     emergencyAlertLevel: Int,     @Nullable callback: EmergencyAlertCompletionCallback)
Start and send an emergency alert message
Link copied to clipboard
open fun startEmergencyAlertWithConnectedChannel(    @NonNull context: Context,     @Nullable attendingParticipants: String,     emergencyAlertLevel: Int,     @Nullable callback: EmergencyAlertCompletionCallback)
Start and send an emergency alert message
Link copied to clipboard
open fun startEmergencyAmbientListeningCall(    @NonNull context: Context,     @Nullable threadId: String,     @NonNull threadName: String,     priority: Int,     @Nullable completionCallback: CompletionCallback)
Start new emergency ambient listening call
Link copied to clipboard
open fun startEmergencyCall(    @NonNull context: Context,     @NonNull threadName: String,     priority: Int,     @Nullable completionCallback: CompletionCallback,     @Nullable fallbackCallback: FallbackCallback)
open fun startEmergencyCall(    @NonNull context: Context,     @NonNull threadName: String,     priority: Int,     needRequestMediaBurst: Boolean,     @Nullable completionCallback: CompletionCallback,     @Nullable fallbackCallback: FallbackCallback)
Start new emergency alert call
Link copied to clipboard
open fun startEmergencyCallWithConnectedChannel(    @NonNull context: Context,     @Nullable recipients: String,     @NonNull threadName: String,     priority: Int,     @Nullable completionCallback: CompletionCallback,     @Nullable fallbackCallback: FallbackCallback)
Start new emergency alert call to the recipients include the member of selected channel
Link copied to clipboard
open fun stopEmergencyAlert(    @NonNull context: Context,     @NonNull threadId: String,     @Nullable callback: EmergencyAlertCompletionCallback)
Stop the emergency alert corresponding the the specified thread
Link copied to clipboard
open fun stopEmergencyAmbientListeningAlert(    @NonNull context: Context,     @NonNull threadId: String,     @Nullable callback: EmergencyAlertCompletionCallback)
Stop the emergency Ambient Listening alert corresponding the the specified thread
Link copied to clipboard
open fun unregisterEmergencyListener(@NonNull listener: STWEmergencyListener)
Unregister the specified listener to not receive any more the Emergency State changes