notify-simple-desktop-notification
Reactive icon

{Notify} - Simple Desktop Notification

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 27 June 2023
 by 
EONE TECHNOLOGIES PRIVATE LIMITED
5.0
 (1 rating)
notify-simple-desktop-notification

{Notify} - Simple Desktop Notification

Documentation
1.0.0


  1. Take the dependency of the below actions and web blocks.
  2. Add this block into your screen / layout.
  3. Add your logic with the below action.
  4. Enable notification in your browser.
  5. Also ensure you have turned off do not disturb mode in settings.
  6. That's it. it will send you a desktop notification like this. 


  7. Enjoy!!




https://github.com/alexgibson/notify.js

Usage

To initialize a web notification create a new Notify instance, passing the message title as well as any other options you wish to use.

var myNotification = new Notify('Yo dawg!', {
    body: 'This is an awesome notification',
    notifyShow: onNotifyShow
});

function onNotifyShow() {
    console.log('notification was shown!');
}

Then show the notification.

myNotification.show();

It's a good idea to make sure that you have permissions to send notifications first.

if (!Notify.needsPermission) {
    doNotification();
} else if (Notify.isSupported()) {
    Notify.requestPermission(onPermissionGranted, onPermissionDenied);
}

function onPermissionGranted() {
    console.log('Permission has been granted by the user');
    doNotification();
}

function onPermissionDenied() {
    console.warn('Permission has been denied by the user');
}

Required parameters

  • title (string) - notification title