public class SrnRichNotificationManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SrnRichNotificationManager.ErrorType
Indicates the reason of error.
|
static interface |
SrnRichNotificationManager.EventListener
This interface is used to notify the application code about the information
regarding the rich notifications.
|
Constructor and Description |
---|
SrnRichNotificationManager(Context context)
Constructs the rich notification manager.
|
Modifier and Type | Method and Description |
---|---|
void |
dismiss(UUID uuid)
Dismisses an active rich notification in the
SrnRichNotificationManager that are associated with this package
name. |
void |
dismissAll()
Dismisses all active rich notifications in the
SrnRichNotificationManager that are associated with this package
name. |
boolean |
isConnected() |
UUID |
notify(SrnRichNotification notification)
Notifies the rich notification service about a new or updated rich
notification.
|
void |
registerRichNotificationListener(SrnRichNotificationManager.EventListener listener)
Registers a
SrnRichNotificationManager.EventListener to receive a callback. |
static void |
setRouteCondition(Notification androidNotification)
Use this call when you want the
SrnRichNotificationManager to
format and route your regular android notification to peripheral clients. |
void |
showErrorToast(UUID uuid,
String errorMessage)
Sends a request to show an error toast for a
SrnRichNotification . |
void |
start()
Start the Rich Notification Manager.
|
void |
stop()
Stop the Rich Notification Manager.
|
void |
unregisterRichNotificationListener(SrnRichNotificationManager.EventListener listener)
Unregisters a
SrnRichNotificationManager.EventListener . |
public SrnRichNotificationManager(Context context)
context
- the context of your application.NullPointerException
- If context is null.public void start()
IllegalStateException
- If this manager is already started.stop()
public void stop()
IllegalStateException
- If this manager is not started.public UUID notify(SrnRichNotification notification)
If a rich notification with the same UUID
is notified
and is active in the service, then it will be updated.
notification
- the rich notification to be posted.UUID
of the posted rich notification.SecurityException
- If the required permission is not present.NullPointerException
- If notification is null.IllegalArgumentException
- If a notification misses mandatory fields such as a primary template of
SrnRichNotification
or choices of SrnRemoteInputAction.SingleSelectInputMode
.IllegalStateException
- If this manager is not started.public void showErrorToast(UUID uuid, String errorMessage)
SrnRichNotification
.
This should be used to inform the user when an SrnAction
has failed or can't be completed.
uuid
- the UUID
of the rich notification error
toast which are shown to be associated with.errorMessage
- the error message to be shown.NullPointerException
- If uuid is null.NullPointerException
- If errorMessage is null.IllegalStateException
- If this manager is not started.public void dismiss(UUID uuid)
SrnRichNotificationManager
that are associated with this package
name. You will receive a SrnRichNotificationManager.EventListener.onRemoved(UUID)
callback.uuid
- the UUID
of the rich notification to be
dismissed.NullPointerException
- If uuid is null.IllegalStateException
- If this manager is not started.public void dismissAll()
SrnRichNotificationManager
that are associated with this package
name. You will receive multiple SrnRichNotificationManager.EventListener.onRemoved(UUID)
callback.IllegalStateException
- If this manager is not started.public void registerRichNotificationListener(SrnRichNotificationManager.EventListener listener)
SrnRichNotificationManager.EventListener
to receive a callback.listener
- the listener to be registered.NullPointerException
- If the listener is null.public void unregisterRichNotificationListener(SrnRichNotificationManager.EventListener listener)
SrnRichNotificationManager.EventListener
.listener
- the listener to be unregistered.public boolean isConnected()
public static void setRouteCondition(Notification androidNotification)
SrnRichNotificationManager
to
format and route your regular android notification to peripheral clients.androidNotification
- the android.app.Notification that should have the
condition set.Copyright © Samsung Electronics, Co., Ltd. All rights reserved.