public abstract class NotificationsService
extends java.lang.Object
The interface to the platform notification services.
Usage is as easy as:NotificationsService notificationsService = platform.getNotificationService(); notificationsService.setRemoteNotificationHandler(myHandler); notificationsService.registerForNotificationTypes(NotificationType.Alert, NotificationType.Badge);
Modifier and Type | Class and Description |
---|---|
static class |
NotificationsService.NotificationType
The possible notification types you can register to.
|
static interface |
NotificationsService.RemoteNotificationHandler
The handler interface to process messages from the notifications system
|
Modifier and Type | Field and Description |
---|---|
protected java.util.EnumSet<NotificationsService.NotificationType> |
reportedNotificationTypes
collection of
NotificationsService.NotificationType s the user allowed to receive |
Modifier | Constructor and Description |
---|---|
protected |
NotificationsService() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doRegisterForNotificationTypes(NotificationsService.NotificationType... notificationTypes) |
abstract java.util.EnumSet<NotificationsService.NotificationType> |
getCurrentNotificationTypes()
return the collection of notification currently active.
|
java.util.EnumSet<NotificationsService.NotificationType> |
getRegisteredNotificationTypes()
return the collection of notifications you used with the
registerForNotificationTypes(NotificationType...) call |
NotificationsService.RemoteNotificationHandler |
getRemoteNotificationHandler() |
java.util.EnumSet<NotificationsService.NotificationType> |
getReportedNotificationTypes()
return the collection of notifications usable for the application reported by the notification system.
|
abstract boolean |
isNotificationTypeSupported(NotificationsService.NotificationType notificationTypes)
Check to see if the given
NotificationsService.NotificationType is supported by the notification sytem |
void |
registerForNotificationTypes(NotificationsService.NotificationType... notificationTypes)
actually to register for the given notification types.
|
void |
setRemoteNotificationHandler(NotificationsService.RemoteNotificationHandler remoteNotificationHandler)
setup your notification handler which will be called during the registration
process or when a notification has been received.
|
protected java.util.EnumSet<NotificationsService.NotificationType> reportedNotificationTypes
NotificationsService.NotificationType
s the user allowed to receivepublic NotificationsService.RemoteNotificationHandler getRemoteNotificationHandler()
public void setRemoteNotificationHandler(NotificationsService.RemoteNotificationHandler remoteNotificationHandler)
remoteNotificationHandler
- The notification handlerpublic final void registerForNotificationTypes(NotificationsService.NotificationType... notificationTypes)
notificationTypes
- Given notification typespublic java.util.EnumSet<NotificationsService.NotificationType> getRegisteredNotificationTypes()
registerForNotificationTypes(NotificationType...)
callpublic java.util.EnumSet<NotificationsService.NotificationType> getReportedNotificationTypes()
getRegisteredNotificationTypes()
e.g. if the user did not permit
all notifications you requested.public abstract boolean isNotificationTypeSupported(NotificationsService.NotificationType notificationTypes)
NotificationsService.NotificationType
is supported by the notification sytemnotificationTypes
- notification typeprotected abstract void doRegisterForNotificationTypes(NotificationsService.NotificationType... notificationTypes)
public abstract java.util.EnumSet<NotificationsService.NotificationType> getCurrentNotificationTypes()
getReportedNotificationTypes()
e.g. if the user changed the permitted notification after program setup.