public interface

AlertsManager

com.mapsted.alerts.AlertsManager
Known Indirect Subclasses

Class Overview

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.

Summary

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.

Public Methods

public 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. BaseAlert can be ScheduledAlert or EmergencyAlert.

Parameters
alertIds input parameter
callback callback for result

public 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. BaseAlert can be ScheduledAlert or EmergencyAlert.

Returns
  • list of base alerts

public abstract void fetchEmergencyAlerts (int propertyId, Consumer<List<EmergencyAlert>> callback)

Get emergency alerts for a property

Parameters
propertyId property id
callback callback with result

public abstract void fetchScheduledAlertsById (String alertId, Consumer<ScheduledAlert> callback)

Use this method to get the scheduled alert object if you have the alertId.

Parameters
alertId alert id
callback callback for result

public abstract List<ScheduledAlert> getOngoingAlertsForEntity (int propertyId, int buildingId, int floorId, int entityId)

Get ongoing or active scheduled alerts for an entity.

Parameters
propertyId entity's propertyId
buildingId entity's buildingId
floorId entity's floorId
entityId entity's id
Returns
  • list of scheduled alerts

public abstract List<ScheduledAlert> getOngoingAlertsForProperty (int propertyId)

Get ongoing scheduled alerts at a property.

Parameters
propertyId property id
Returns
  • list of scheduled alerts

public abstract void onDestroy ()

Call onDestroy when your application exits.

public abstract void registerListener (AlertsOnChangeListener alertsOnChangeListener)

Register onChangeListener for property user is interested in but not necessarily at the property.

public abstract void sendFirebaseTokenForEmergencyAlerts (Context appContext, CoreApi coreApi, String token)

Use this to send firebase token to receive emergency alerts via firebase messaging service. You must create a service by extending EmergencyAlertsFirebaseMessagingService

Parameters
appContext app context
token firebaseToken

public abstract void setUserAtLocationCallback (AlertsManagerImpl.UserAtLocationCallback userAtLocationCallback)

Set callback for when scheduled alerts triggers while the user is at a property. You can show this to user using MapstedInAppNotificationsApi

Parameters
userAtLocationCallback callback with the ScheduledAlert that got triggered.

public abstract void unregisterListener (AlertsOnChangeListener alertsOnChangeListener)

Unregister a previously registered callback.