2.0.8 • Published 5 years ago

ember-cli-pushjs v2.0.8

Weekly downloads
24
License
MIT
Repository
github
Last release
5 years ago

Ember Observer Score Build Status Coverage Status NPM Version NPM Downloads Dependency Status DevDependency Status Greenkeeper

ember-cli-pushjs

Simple Wrapper around Push JS. This provides a service that can be used to send system / web notifications

DEMO

Installation

ember install ember-cli-pushjs

Usage

import Route from '@ember/routing/route';

import { inject } from '@ember/service';

export default Route.extend({
  push: inject(),

  setupController(controller) {
    this._super(...arguments);
    controller.setProperties({
      timeout: 5000,
      title: 'Test Notification',
      body: 'How does it feel for this to be so easy?',
      icon: 'https://lh5.ggpht.com/ZHrKRvpiLuDpAzK55_VJUXf0g22TM_jHWb5fMG1GUSnt6NtFVoxzlDvqjbi_f7005dU=w300'
    })
  },

  actions: {
    notify() {
      let { title, body, icon, timeout } = this.get('controller');
      this.get('push').create(title, {
        body, icon, timeout
      })
    }
  }
});

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.