webkit notification service for angularjs
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
providers
.gitignore
Gruntfile.js
README.md
bower.json
component.json
index.js
package.json

README.md

notifications

a simple notifications service for angularjs

usage

Dropin somewhere in your config's a setup your defaults with

NotificationProvider.setDefaults({
  image: "path/to/your/default/image.png",
  title: "my default title",
  text: "my default body",
  show: 1000 // default delay to show, or just true to show immediately
});

And then from anywhere in your code create a new notification with

Notification.create({
  image: "path/to/your/awesome-image.png",
  title: "Ahoy!",
  text: "This is a notification yeah!",
  show: true
});

worth knowing

Notification.create will create a new notification if it can, or it will queue it and will ask the browser for permissions and then create it.

You can smash a bunch of Notification.create together and have the service queue them all with different timings so after the users gives the app permissions BAM, the notifications start flowing :)

Bitdeli Badge