STWAccount Manager
STWAccountManager
This class represent the API for all actions/event related to the user account
This class offers several possible operations defined in the following list:
- Login
- Logout
- Manage all account settings
- Listen to all changes of account settings
Login
STWAccountManager.getInstance().login(BaseLoginActivity.this, number, companyId, new STWAccountManager.CompletionCallback() { public void onSecondStepStarted(int loginStatus) { //Code... } public void onCompletion(int loginType, Bundle data) { //Code... } public void onError(int loginFailReason, Bundle data) { //Code... } });Content copied to clipboardSTWAccountManager.getInstance().confirmLogin(context, activationCode, new STWAccountManager.CompletionCallback() { public void onSecondStepStarted(int loginStatus) { //Your code here } public void onCompletion(int loginType, Bundle data) { //Your code here } public void onError(int loginFailReason, Bundle data) { //Your code here } });Content copied to clipboard
Logout
STWAccountManager.getInstance().launchLogoutProcess(context,true, new LogoutCallBack() {
public void onStart() {
//Code ...
}
public void onFinish() {
//Code ...
}
public void onError() {
//Code ...
}
});
Content copied to clipboard
Manage all account settings
//Delete user picture
STWAccountManager.getInstance().deleteUserPicture(new STWSettingRequestCallback() {
public void onSuccess(){
//Code ...
}
public void onFail() {
//Code ...
}
public void onError(){
//Code ...
}
});
Content copied to clipboard
Get company id
String companyId = STWAccountManager.getInstance().getCompanyId(context);
Content copied to clipboard
Listen to all changes of account settings
STWAccountManager.getInstance().registerAccountSettingsListener(new STWAccountSettingsListener() {
public void onAccountSettingsUpdated(){
//Code..
}
});
Content copied to clipboard
Functions
Link copied to clipboard
This method is useful when the current account is used by another device and want to use the current device
Link copied to clipboard
open fun <R : RegistrationCallback?> checkConfService( @NonNull context: Context, @NonNull phoneNumber: String, @NonNull companyId: String, @Nullable callback: R)
Content copied to clipboard
To check the configuration service
Link copied to clipboard
open fun checkScreenCaptureEnabled(@NonNull context: Context, defaultStatus: Boolean): Boolean
Content copied to clipboard
Call this method to check whether the screen capture is enable or not based on the configured parameter in the BE admin interface or the defaultStatus if not configured.
Link copied to clipboard
Call this method to clear saved companyId
Link copied to clipboard
open fun <R : RegistrationCallback?> confirmLogin(@NonNull context: Context, @Nullable registrationCallback: R)
Content copied to clipboard
To be called after receiving a BAD_DEVICE_ID error.
Link copied to clipboard
Link copied to clipboard
Call this method to get the default android icons Uri based on the configured parameter in the BE admin interface or null if not configured.
Link copied to clipboard
Gets the current connection state with the backend.
Link copied to clipboard
Retrieve the current saved account phone number
Link copied to clipboard
Link copied to clipboard
Returns the latest application revision published
Link copied to clipboard
Returns the latest application version published
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Returns the region where the current account phone number is from
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Returns the url address for on-line help
Link copied to clipboard
Call this method to get the [HTTP ports] either configured in the BE admin interface or default if not configured.
Link copied to clipboard
Link copied to clipboard
Gets instance.
Link copied to clipboard
retrieve the current login type
Link copied to clipboard
Link copied to clipboard
open fun getOauthTokenForExternalApi(@NonNull context: Context, @Nullable callback: STWOauthTokenCallback<OauthTokenError>)
Content copied to clipboard
Gets an oauth token useful to connect to an external API
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Call this method to get the network capability either configured in the BE admin interface or default if not configured.
Content copied to clipboard
Please use getRestrictedNetworkCapability Call this method to get the network capability either configured in the BE admin interface or default if not configured.
Link copied to clipboard
Call this method to get the [SIP/VoIP ports] either configured in the BE admin interface or default if not configured.
Link copied to clipboard
Link copied to clipboard
Returns the e-mail address for support
Link copied to clipboard
Link copied to clipboard
open fun isAppAlwaysConnectedModeEnabled(@NonNull context: Context): Boolean
Content copied to clipboard
Check if the app is in the always connected mode or not.
Link copied to clipboard
open fun isDebugActionModeEnabled(@NonNull context: Context, defaultStatus: Boolean): Boolean
Content copied to clipboard
Call this method to check whether all debug actions (copy db file, activate logs, send logs,...) activated or not based on the configured parameter in the BE admin interface or the defaultStatus if not configured.
Link copied to clipboard
open fun isDedicatedNetFallbackEnabled(@NonNull context: Context): Boolean
Content copied to clipboard
Call this method to check whether the app must allow fallback if restricted network is not available or not.
Content copied to clipboard
Please use isDedicatedNetFallbackEnabled Call this method to check whether the app must allow fallback if restricted network is not available or not.
Link copied to clipboard
open fun isExternalUserInvitationAllowed(@NonNull context: Context): Boolean
Content copied to clipboard
Method to check if the virality - External user invitation feature is allowed ot not
Link copied to clipboard
Call this method to check whether the fallback ports for HTTP and/or Sip is enabled or not based on the configuration of the http/sip ports in the BE admin interface or default if not configured.
Link copied to clipboard
open fun isInstallationDoneWithoutSIM(@NonNull context: Context): Boolean
Content copied to clipboard
Call this method to check if the login has been done with SIM card or not
Link copied to clipboard
Method to check if the invitation by Email is active or not
Link copied to clipboard
Method to check if the invitation by SMS is active or not
Link copied to clipboard
Returns whether the app is logged using the NFC tag or not
Link copied to clipboard
open fun isLogoutEnabled(@NonNull context: Context, defaultStatus: Boolean): Boolean
Content copied to clipboard
Call this method to check if the [logout] feature is enabled or not based on the configured parameter in the BE admin interface or the defaultStatus if not configured.
Link copied to clipboard
open fun isNewAppVersionNotificationEnabled(@NonNull context: Context): Boolean
Content copied to clipboard
Check if the new application version notification is allowed to be shown from administrator or not.
Link copied to clipboard
open fun isOnlineHelpEnabled(@NonNull context: Context, defaultStatus: Boolean): Boolean
Content copied to clipboard
Call this method to check whether the online help is activated or not based on the configured parameter in the BE admin interface or the defaultStatus if not configured.
Link copied to clipboard
open fun isPrivacyPolicyEnabled(@NonNull context: Context, defaultStatus: Boolean): Boolean
Content copied to clipboard
Call this method to check whether the privacy policy is activated or not based on the configured parameter in the BE admin interface or the defaultStatus if not configured.
Link copied to clipboard
open fun isSecureStorageCheckerEnabled(@NonNull context: Context): Boolean
Content copied to clipboard
Call this method to check whether the security disc encryption feature is enabled or not based on the configured parameter in the BE admin interface or the defaultStatus if not configured.
Link copied to clipboard
open fun isTermOfUseEnabled(@NonNull context: Context, defaultStatus: Boolean): Boolean
Content copied to clipboard
Call this method to check whether the term of use is activated or not based on the configured parameter in the BE admin interface or the defaultStatus if not configured.
Link copied to clipboard
open fun isTLSEnabledForArcGIS(@NonNull context: Context, defaultStatus: Boolean): Boolean
Content copied to clipboard
Call this method to check whether ArcGIS &Addok requests use TLS with https or not based on the configured parameter in the BE admin interface or the defaultStatus if not configured.
Link copied to clipboard
open fun isTLSEnabledForOSM(@NonNull context: Context, defaultStatus: Boolean): Boolean
Content copied to clipboard
Call this method to check whether OSM requests use TLS with https or not based on the configured parameter in the BE admin interface or the defaultStatus if not configured.
Link copied to clipboard
Call this method to check if the current user is authenticated or not.
Link copied to clipboard
open fun isUserAuthenticatedAndAccountSynced(@NonNull context: Context): Boolean
Content copied to clipboard
Call this method to check if the application can be opened or not
Link copied to clipboard
open fun isVulnerabilityCheckerEnabled(@NonNull context: Context): Boolean
Content copied to clipboard
Call this method to check whether the check for rooted/vulnerable devices is enabled or not based on the configured parameter in the BE admin interface or the defaultStatus if not configured.
Link copied to clipboard
open fun localDisconnect(@NonNull context: Context, @Nullable callBack: STWDisconnectCallBack)
Content copied to clipboard
Call this method to do a local disconnect (simulate the system FORCE-STOP application) It is required, before invoke this method, to : - close ALL activities - cancel ALL notifications - stop services (or foreground services) - unregister from any broadcast receiver An event STWAutomaticDisconnectListener will be delegated when the disconnection process started or finished.
Link copied to clipboard
Link copied to clipboard
Whether the client application must be updated or not
Link copied to clipboard
open fun register( @NonNull context: Context, @NonNull companyId: String, @Nullable registrationCallback: RegisterOrganisationCallback)
Content copied to clipboard
Call this method to start registration with only companyId .
open fun <R : RegistrationCallback?> register( @NonNull context: Context, @NonNull userIdentifier: String, @NonNull companyId: String, @Nullable registrationCallback: R)
Content copied to clipboard
Call this method to start registration.The method should be called at the first beginning.
Link copied to clipboard
open fun registerForAutomaticDisconnectListener(@NonNull automaticDisconnectListener: STWAutomaticDisconnectListener)
Content copied to clipboard
Call this method to register for events related to automatic disconnect feature
Link copied to clipboard
open fun registerToAccountSessionState(@NonNull callback: STWAccountSessionCallback)
Content copied to clipboard
Register to the service connection states and errors
Link copied to clipboard
open fun registerToAppVersionChanges(@NonNull listener: STWAppVersionListener)
Content copied to clipboard
Register listener to handle events related to App version updates.
Link copied to clipboard
open fun registerToExternalUserEvents(@Nullable externalUserCallback: STWExternalUserListener)
Content copied to clipboard
Listen to the virality-External user invitation events.
Link copied to clipboard
open fun registerToIncorporateGuestListener(@Nullable incorporateGuestListener: STWIncorporateGuestListener)
Content copied to clipboard
Listen to the to the event related to the incorporate of guest in the organisation.
Link copied to clipboard
Call this method reset all application data including local preferences &database...
Link copied to clipboard
open fun synchronizedWithOtherDevices(@NonNull context: Context): Boolean
Content copied to clipboard
Whether the current subscriber uses other device(s) (i.
Link copied to clipboard
open fun unregisterForAutomaticDisconnectListener(@NonNull automaticDisconnectListener: STWAutomaticDisconnectListener)
Content copied to clipboard
Call this method to unregister from events related to automatic disconnect feature
Link copied to clipboard
open fun unregisterForDisconnectedUserFeatureChanged(@NonNull disconnectedUserFeatureChangedListener: STWDisconnectedUserFeatureChangedListener)
Content copied to clipboard
Call this method to unregister from events related to connected user feature
Link copied to clipboard
open fun unregisterFromAccountSessionState(@NonNull callback: STWAccountSessionCallback)
Content copied to clipboard
Unregister from the service connection states and errors
Link copied to clipboard
open fun unregisterFromExternalUserEvents(@Nullable externalUserCallback: STWExternalUserListener)
Content copied to clipboard
Stop listening to the virality-External user invitation events.
Link copied to clipboard
open fun unregisterFromIncorporateGuestListener(@Nullable incorporateGuestListener: STWIncorporateGuestListener)
Content copied to clipboard
Stop listening to the to the event related to the incorporate of guest in the organisation.
Link copied to clipboard
open fun unregisterToAppVersionChanges(@NonNull listener: STWAppVersionListener)
Content copied to clipboard
unregister listener to not handle anymore the events related to App version updates.
Link copied to clipboard
Call this method to check whether the SmartMS &Mobile uses phone numbers or not.