https://github.com/billstclair/elm-system-notification
Elm Interface to the Notifications API
https://github.com/billstclair/elm-system-notification
Last synced: 8 months ago
JSON representation
Elm Interface to the Notifications API
- Host: GitHub
- URL: https://github.com/billstclair/elm-system-notification
- Owner: billstclair
- License: mit
- Created: 2018-07-12T10:28:05.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-12T11:12:00.000Z (almost 8 years ago)
- Last Synced: 2025-10-08T12:35:38.377Z (8 months ago)
- Language: Elm
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](http://package.elm-lang.org/packages/billstclair/elm-system-notification/latest)
`billstclair/elm-system-notification` is an Elm interface to the [Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API). It allows your application to request permission to create system notifications, and, if granted, create them.
Notifications don't work from localhost in Chrome, so don't be surprised if you don't see them when running from `elm reactor`.
See the "example" directory for a simple use case.
In order to use it, your top-level program needs to have a port with which to communicate with the JavaScript code:
port notify : NotifyPort
You need to compile your program to a site directory:
elm make Main.elm --output site/index.js
And you need a top-level HTML file similar to [site/index.html](https://github.com/billstclair/elm-system-notification/blob/master/site/index.html).
Bill St. Clair
12 July 2018