A NotificationService subscribes to a Notifications container of the StreamLink user and allows the user to register a listener to be called when notifications are triggered or dismissed.
The service itself does not subscribe to anything unless listeners are added to it. For every listener added one subscription is being issued. These subscriptions induce the service state for the associated listeners. Therefore the service states can vary for different listeners. If the reference to the service is removed without removing all listeners beforehand, open subscriptions will stay around forever. To avoid that, remove all listeners before removing the service.
Attributes | Name and Description |
---|---|
|
caplin.streamlink.alerts.NotificationService()
|
Attributes | Name and Description |
---|---|
|
void
addListener( listener)
Adds a notification listener that will be called back when notifications are triggered or dismissed. |
|
void
dismissNotification( notification, listener)
Dismiss a notification for the current user. |
|
void
removeListener( listener)
Removes a previously added notification listener, callbacks to this listener will be stopped. |
►
caplin.streamlink.alerts.NotificationService()
►
void
addListener( listener)
Adds a notification listener that will be called back when notifications are triggered or dismissed.
listener | The NotificationListener to be added. |
►
void
dismissNotification( notification, listener)
Dismiss a notification for the current user.
notification | the notification to dismiss. | |
listener | a ResultListener that will be called back to notify the user code whether the operation was sent to liberator successfully or not |
►
void
removeListener( listener)
Removes a previously added notification listener, callbacks to this listener will be stopped.
listener | The NotificationListener to be removed |