Interface AppNotificationHandler


  • public interface AppNotificationHandler
    Handler to send app notifications (aka push notifications).
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canReceiveNotifications​(BasicUser user)
      Returns true if app notifications were configured for the user (i.e isEnabled(ConfigurationAccessor) is true) and the user has the required mediums to receive it (e.g in case of FCM, has a registration token assigned).
      Returning false means no app notifications will be sent to this specific user.
      boolean isEnabled​(ConfigurationAccessor configuration)
      Returns whether the app notifications are configured for the given configuration.
      boolean notify​(AppNotificationMessage notification)
      Sends (synchronously) a new app notification.
      <T> T unwrap​(Class<T> clazz, BasicUser user)
      Returns an object of the specified type to allow access to the underlying implementation.
      If the current implementation does not support the specified class or the given user can not receive notifications, null is returned.
      void validate​(BasicUser user, Object medium)
      Validates the given medium used to send the app notification to the user.
      The medium depends on the underlying implementation (e.g in case of FCM it would be a token of type String).