/meteor-desktop-system-notifications

A plugin for meteor-desktop that enabled native system notifications/toasts and icon badges

Primary LanguageJavaScriptMIT LicenseMIT

meteor-desktop-system-notifications

CircleCI CircleCI


A plugin for meteor-desktop that enabled native system notifications/toasts and icon badges.

Supports native system notifications in macOS and Windows 10 and falls back to electron-notifications for other Windows 7 & 8.

Did not test on Linux so any help is appreciated.

macOS app icon badge

macOS Icon Badge

macOS notification

macOS notification

Windows app icon badge

Windows Icon Badge

Windows 8 notification

Windows 8 notification

Windows 10 notification

Windows 10 notification

Linux app icon badge

Not tested

Linux notification

Not tested

Usage

In your .desktop/settings.json add this package to your plugins list:

{
    "meteor-desktop-system-notifications": {
        "version": "0.0.2"
    },
}

On the Meteor side you can do the following:

  • To set a badge on the app's icon
Desktop.send('systemNotifications', 'setBadge', unreadCount);
  • To show a system notification
Desktop.send('systemNotifications', 'notify', {
    title: 'Title',
    text: 'Text',
    icon: 'Icon Url',
    data: {
        someVar: 'someValue',
    },
});
  • To handle click on a notification
Desktop.on('systemNotifications', 'notificationClicked', (sender, data) => {
    //handle click
    //data is the data object you passed to notify
});

Changelog

  • 0.0.2
    • app now gets focus when clicking a notification in windows 10
  • 0.0.1
    • intial release

Lots more to do