java.lang.Object | |
↳ | com.mapsted.alerts.AlertsManagerImpl |
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.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | AlertsManagerImpl.UserAtLocationCallback | Callback for scheduled alert triggers when user is at the location. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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.
| ||||||||||
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.
| ||||||||||
void |
fetchEmergencyAlerts(int propertyId, Consumer<List<EmergencyAlert>> callback)
Get emergency alerts for a property
| ||||||||||
void |
fetchScheduledAlertsById(String alertId, Consumer<ScheduledAlert> callback)
Use this method to get the scheduled alert object if you have the alertId.
| ||||||||||
synchronized static AlertsManager |
getInstance(Context context, CoreApi coreApi)
Get the singleton AlertManager
| ||||||||||
List<ScheduledAlert> |
getOngoingAlertsForEntity(int propertyId, int buildingId, int floorId, int entityId)
Get ongoing or active scheduled alerts for an entity.
| ||||||||||
List<ScheduledAlert> |
getOngoingAlertsForProperty(int propertyId)
Get ongoing scheduled alerts at a property.
| ||||||||||
void |
onDestroy()
Call onDestroy when your application exits.
| ||||||||||
void |
registerListener(AlertsOnChangeListener alertsOnChangeListener)
Register onChangeListener for property user is interested in but not necessarily at the property.
| ||||||||||
void |
sendFirebaseTokenForEmergencyAlerts(Context appContext, CoreApi coreApi, String token)
Use this to send firebase token to receive emergency alerts via firebase messaging service.
| ||||||||||
void |
setUserAtLocationCallback(AlertsManagerImpl.UserAtLocationCallback userAtLocationCallback)
Set callback for when scheduled alerts triggers while the user is at a property.
| ||||||||||
void |
unregisterListener(AlertsOnChangeListener alertsOnChangeListener)
Unregister a previously registered callback.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
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 the singleton AlertManager
coreApi | an initialized coreApi |
---|
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.