npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-blueprint-firebase-messaging

v0.7.6

Published

The default blueprint for ember-cli addons.

Downloads

15

Readme

ember-blueprint-firebase-messaging

An add-on for integrating Firebase Messaging into your Ember App

Installation

ember install ember-blueprint-firebase-messaging

Configuration

Application Configuration

Set the firebase.baseUrl property in configs/environment.js. This url points to the mounting point for the main router from @onehilltech/blueprint-firebase-messaging.

module.exports = function (environment) {
  let ENV = {
    // ...
    
    firebase: {
      baseUrl: `http://localhost:8080/firebase`
    }
  };
  
  // ...
}

Capacitor Mobile Apps

You must set the environment variable CAPACITOR_BUILD=true when you build your EmberJS application for capacitor (see ember-cli-capacitor). If you don't set the CAPACITOR_BUILD environment variable, then this add-on will not integrate properly into your capacitor application.

CAPACITOR_BUILD is automatically added to configs/environment.js.

Device Token Registration

The device tokens are automatically registered with the backend server when a user signs in to a gatekeeper session. Also, the device token is removed from the server when a user signs out of their current gatekeeper session.

Handling Push Notifications

Foreground notifications

The @pushNotification decorator is used to handle push notifications while the mobile app is in the foreground. This decorator can be attached to any route in the Ember app. Here is an example of attaching it to the IndexRoute. This approach is useful if you want to handle push notifications in a target route differently from the general notification.

// app/routes/index.js

import { pushNotification } from 'ember-blueprint-firebase-messaging';

export default class IndexRoute extends Route {

  // ...
  
  @pushNotification
  doPaymentCompleteNotification (notification) {
    // handle the notification
  }
}

Background notifications

Background notifications are ones received while the app is not in the foreground. These notifications typically wake the target mobile application when tapped (this will be indicated in the notification). You handle background notifications by implementing the doPushNotification() on the application route. If you do not implement the doPushNotification() method on the application route, then the background push notifications will be ignored.

Background push notifications are only handled after the user taps the notification.

// app/routes/application.js

export default class ApplicationRoute extends Route {
  // ...
  
  doPushNotification (notification) {
    // handle the background notification
  }
}