Class sap.ushell.services.NotificationsModule: sap/ushell/services/Notifications
A UShell service for fetching user notification data from the Notification center/service
and exposing them to the Unified Shell and Fiori applications UI controls.
In order to get user notifications, Unified Shell notification service issues OData requests
to the service defined by the configuration property serviceUrl
,
for example: "/sap/opu/odata4/iwngw/notification/default/iwngw/notification_srv/0001"
.
Unified Shell Notification service has several working modes, depending on the environment and the available resources:
PackagedApp mode: Fiori launchpad runs in the context of PackagedApp
FioriClient mode: Fiori launchpad runs in the context of FioriLaunchpad
WebSocket mode: Fiori launchpad runs in a browser, and WebSocket connection to the notifications provider is available
Polling mode: Fiori launchpad in runs in a browser, and WebSocket connection to the notifications provider is not available
The notification service exposes an API that includes: - Service enabling and initialization
- Registration of callback functions (by Shell/FLP controls) that will be called for every data update
. - Retrieval of notification data (e.g. notifications, number of unseen notifications) - Execution of a notification actions - Marking user notifications as seen
Since: 1.32.0.
Initialization is performed only if the following two conditions are fulfilled:
1.
{object} | sNotificationId | The ID of the notification whose action is being executed |
- Since:
- 1.34
After launching the action, the function gets updated notification data in order to push the updated data to the consumers.
{object} | sNotificationId | The ID of the notification whose action is being executed |
{object} | sActionId | The ID of the action that is being executed |
- Since:
- 1.32
- Since:
- 1.32
{promise} | Promise object that on success - returns all notification items |
- Since:
- 1.38
{promise} | Promise object that on success - returns all notification items |
e.g. Notifications that the user hasn't seen yet.
- Since:
- 1.32
{promise} | Promise object that on success - returns the number of unread notifications of the user |
Initialization is performed only if the following two conditions are fulfilled:
1. Notification service is enabled
2. Notification service hasn't been initialized yet
The main initialization functionality is determining and setting the mode in which notifications are consumed.
The possible modes are:
PACKAGED_APP - Notifications are fetched when a callback is called by PackagedApp environment
FIORI_CLIENT - Notifications are fetched when a callback is called by FioriClient environment
WEB_SOCKET - Notifications are fetched on WebSocket "ping"
POLLING - Notifications are fetched using periodic polling mechanism
- Since:
- 1.32
Enabling is based on the
enable
service configuration flag.The service configuration must also include serviceUrl attribute.
- Since:
- 1.32.0
{boolean} | A boolean value indicating whether the notifications service is enabled |
- Since:
- 1.38
After launching the action, the function gets updated notification data in order to push the updated data to the consumers.
{object} | sNotificationId | The ID of the notification whose action is being executed |
- Since:
- 1.34
the main use-case is when the user navigated to the notification center and sees all the pending notifications.
- Since:
- 1.32