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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Association between an expo token and its associated user -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Check the status of previously sent push notificationsvoid
pushNotifications
(String title, String message, Map<UserIdentity, Set<String>> tokens, Map<String, Object> data) 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
-
-
Constructor Details
-
PushNotificationManager
public PushNotificationManager()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
pushNotifications
public void pushNotifications(String title, String message, Map<UserIdentity, Set<String>> tokens, Map<String, throws io.github.jav.exposerversdk.PushClientException, SchedulerExceptionObject> data) Push a notification to a list of registered devices- Parameters:
title
- title of the messagemessage
- message to sendtokens
- list of device tokensdata
- the data to push- Throws:
io.github.jav.exposerversdk.PushClientException
- something went wrong creating the push clientSchedulerException
- an exception occurs setting up the scheduler for checking push receipts
-
checkTickets
Check the status of previously sent push notifications- Parameters:
tickets
- the map of ticket id to token info (token + user)- Throws:
Exception
- something went wrong while checking the tickets
-