Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tzapu/meteor-desktop-system-notifications
A plugin for meteor-desktop that enabled native system notifications/toasts and icon badges
https://github.com/tzapu/meteor-desktop-system-notifications
Last synced: about 1 month ago
JSON representation
A plugin for meteor-desktop that enabled native system notifications/toasts and icon badges
- Host: GitHub
- URL: https://github.com/tzapu/meteor-desktop-system-notifications
- Owner: tzapu
- License: mit
- Created: 2017-01-12T11:58:53.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-16T11:04:37.000Z (almost 8 years ago)
- Last Synced: 2024-01-02T01:26:50.819Z (almost 1 year ago)
- Language: JavaScript
- Size: 24.4 KB
- Stars: 8
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# meteor-desktop-system-notifications
CircleCI [![CircleCI](https://circleci.com/gh/tzapu/meteor-desktop-system-notifications.svg?style=svg)](https://circleci.com/gh/tzapu/meteor-desktop-system-notifications)---
A plugin for [meteor-desktop](https://www.npmjs.com/package/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](https://github.com/blainesch/electron-notifications) for other Windows 7 & 8.
Did not test on Linux so any help is appreciated.
###### macOS app icon badge
![macOS Icon Badge](http://i.imgur.com/00ALvjK.png)
###### macOS notification
![macOS notification](http://i.imgur.com/muLnGE4.png)###### Windows app icon badge
![Windows Icon Badge](http://i.imgur.com/xTsBrFI.png)
###### Windows 8 notification
![Windows 8 notification](http://i.imgur.com/sEoCZW8.png)
###### Windows 10 notification
![Windows 10 notification](http://i.imgur.com/gxF9iNi.png)###### Linux app icon badge
Not tested
###### Linux notification
Not tested### Usage
In your `.desktop/settings.json` add this package to your plugins list:
```json
{
"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 releaseLots more to do