Package org.ametys.plugins.mobileapp
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 Summary
Modifier and TypeFieldDescriptionprotected UserPreferencesHelper
User Preferences Helperstatic final String
Avalon Role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_handlePushError
(io.github.jav.exposerversdk.PushNotificationException exception, String title, String message, Map<String, Object> data) Handle an exception essentially when trying to push notifications to multiple projects, to do it again for each projectvoid
Push a notification to a list of registered devicesvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role -
_userPreferencesHelper
User Preferences Helper
-
-
Constructor Details
-
PushNotificationManager
public PushNotificationManager()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
pushNotifications
public void pushNotifications(String title, String message, Set<String> tokens, Map<String, Object> data) throws io.github.jav.exposerversdk.PushClientExceptionPush a notification to a list of registered devices- Parameters:
title
- title of the messagemessage
- message to sendtokens
- list of devicet tokensdata
- 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) throws io.github.jav.exposerversdk.PushClientExceptionHandle an exception essentially when trying to push notifications to multiple projects, to do it again for each project- Parameters:
exception
- the exception throwntitle
- title of the notificationmessage
- description of the notificationdata
- data of the notification- Throws:
io.github.jav.exposerversdk.PushClientException
- Something went very wrong
-