Class PushNotificationManager

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.mobileapp.PushNotificationManager
All Implemented Interfaces:
LogEnabled, Component, Serviceable

manager to push notifications to users
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • pushNotifications

      public void pushNotifications(String title, String message, Map<UserIdentity,Set<String>> tokens, Map<String,Object> data) throws io.github.jav.exposerversdk.PushClientException
      Push a notification to a list of registered devices
      Parameters:
      title - title of the message
      message - message to send
      tokens - list of devicet tokens
      data - the data to push
      Throws:
      io.github.jav.exposerversdk.PushClientException - something went wrong
    • _handlePushError

      protected void _handlePushError(io.github.jav.exposerversdk.PushNotificationException exception, String title, String message, Map<String,Object> data, Map<String,UserIdentity> tokenToUserMap) throws io.github.jav.exposerversdk.PushClientException
      Handle an exception essentially when trying to push notifications to multiple expo projects, to do it again for each project
      Parameters:
      exception - the exception thrown
      title - title of the notification
      message - description of the notification
      data - data of the notification
      tokenToUserMap - Reversed user/token map
      Throws:
      io.github.jav.exposerversdk.PushClientException - Something went very wrong