From 26cdaaf62cd147f5272cc7c0522de3661d7882c1 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 14 Feb 2018 18:45:47 +0100 Subject: [PATCH] Draft notifications --- frontend/notifications.md | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 frontend/notifications.md diff --git a/frontend/notifications.md b/frontend/notifications.md new file mode 100644 index 0000000..b2831e7 --- /dev/null +++ b/frontend/notifications.md @@ -0,0 +1,40 @@ +# Notifications + +The application supports two types of notifications: + +1. Desktop notifications +2. App notifications + +Both notifications can be used through the `NotificationManager`. + +## Desktop Notifications + +Desktop notifications make use of the `Notification` Api. These notifications allow to inform the user in the browser and desktop. With push notifications it's possible to send notifications directly to the user without waiting for the user to request outstanding notifications. This can be achieved by making use of `Service Workers`. The push notifications are especially helpful for mobile users to inform them about changes in the app (e.g. new message, new task etc.). + +... service worker implementation coming soon ... + +```js +notifyManager.send( + new jsOMS.Message.Notification.NotificationMessage( + jsOMS.Message.Notification.NotificationStatus.SUCCESS, + 'Title', + 'My Message' + ), + jsOMS.Message.Notification.NotificationType.BROWSER_NOTIFICATION +); +``` + +## App notifications + +App notifications are a custom notification implementation which can be themed and manipulated within the app. These notifications are most helpful for direct user interactions/feedback (e.g. giving the user feedback if the input was successful or not). + +```js +notifyManager.send( + new jsOMS.Message.Notification.NotificationMessage( + jsOMS.Message.Notification.NotificationStatus.SUCCESS, + 'Title', + 'My Message' + ), + jsOMS.Message.Notification.NotificationType.APP_NOTIFICATION +); +``` \ No newline at end of file