com.mapsted.alerts.AlertsManager |
![]() |
AlertsManager class is used to get alerts for a property. It also provides callbacks for alerts which should be activated based on user position transition in the property. Use Mapsted Hub dashboard to setup the alerts for your property.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
fetchAlertsByAlertIds(List<String> alertIds, Consumer<List<BaseAlert>> callback)
Use this method to get scheduled and emergency alerts from local db if you have the alertIds.
| ||||||||||
abstract List<BaseAlert> |
fetchAlertsByAlertIds(List<String> alertIds)
Use this method to get the scheduled and emergency alert objects from local db if you have the alertIds.
| ||||||||||
abstract void |
fetchEmergencyAlerts(int propertyId, Consumer<List<EmergencyAlert>> callback)
Get emergency alerts for a property
| ||||||||||
abstract void |
fetchScheduledAlertsById(String alertId, Consumer<ScheduledAlert> callback)
Use this method to get the scheduled alert object if you have the alertId.
| ||||||||||
abstract List<ScheduledAlert> |
getOngoingAlertsForEntity(int propertyId, int buildingId, int floorId, int entityId)
Get ongoing or active scheduled alerts for an entity.
| ||||||||||
abstract List<ScheduledAlert> |
getOngoingAlertsForProperty(int propertyId)
Get ongoing scheduled alerts at a property.
| ||||||||||
abstract void |
onDestroy()
Call onDestroy when your application exits.
| ||||||||||
abstract void |
registerListener(AlertsOnChangeListener alertsOnChangeListener)
Register onChangeListener for property user is interested in but not necessarily at the property.
| ||||||||||
abstract void |
sendFirebaseTokenForEmergencyAlerts(Context appContext, CoreApi coreApi, String token)
Use this to send firebase token to receive emergency alerts via firebase messaging service.
| ||||||||||
abstract void |
setUserAtLocationCallback(AlertsManagerImpl.UserAtLocationCallback userAtLocationCallback)
Set callback for when scheduled alerts triggers while the user is at a property.
| ||||||||||
abstract void |
unregisterListener(AlertsOnChangeListener alertsOnChangeListener)
Unregister a previously registered callback.
|
Use this method to get scheduled and emergency alerts from local db if you have the alertIds.
BaseAlert
can be ScheduledAlert
or EmergencyAlert
.
alertIds | input parameter |
---|---|
callback | callback for result |
Use this method to get the scheduled and emergency alert objects from local db if you have the alertIds.
BaseAlert
can be ScheduledAlert
or EmergencyAlert
.
Get emergency alerts for a property
propertyId | property id |
---|---|
callback | callback with result |
Use this method to get the scheduled alert object if you have the alertId.
alertId | alert id |
---|---|
callback | callback for result |
Get ongoing or active scheduled alerts for an entity.
propertyId | entity's propertyId |
---|---|
buildingId | entity's buildingId |
floorId | entity's floorId |
entityId | entity's id |
Get ongoing scheduled alerts at a property.
propertyId | property id |
---|
Call onDestroy when your application exits.
Register onChangeListener for property user is interested in but not necessarily at the property.
Use this to send firebase token to receive emergency alerts via firebase messaging service.
You must create a service by extending EmergencyAlertsFirebaseMessagingService
appContext | app context |
---|---|
token | firebaseToken |
Set callback for when scheduled alerts triggers while the user is at a property.
You can show this to user using MapstedInAppNotificationsApi
userAtLocationCallback | callback with the ScheduledAlert that got triggered. |
---|
Unregister a previously registered callback.