Giter Site home page Giter Site logo

quasar-app-extension-firebase-messaging's Introduction

Quasar Firebase Messaging App Extension

Install

yarn add firebase
yarn add quasar-app-extension-firebase-messaging
quasar ext invoke firebase-messaging

Setup

Create a file named firebase-messaging-sw.js in src-pwa The package will concatenate the firebase imports at its start

firebase.initializeApp({...});

const messaging = firebase.messaging();

messaging.setBackgroundMessageHandler(function(payload) {
  console.log('[firebase-messaging-sw.js] Received background message ', payload);
  // Customize notification here
  const notificationTitle = 'Background Message Title';
  const notificationOptions = {
    body: 'Background Message body.',
    icon: '/firebase-logo.png'
  };

  return self.registration.showNotification(notificationTitle,
    notificationOptions);
});

Also, make the entry firebase-messaging-sw.js the entry service worker for your pwa

// replace line
register(process.env.SERVICE_WORKER_FILE, {
--->
// by
register('firebase-messaging-sw.js', {

quasar-app-extension-firebase-messaging's People

Contributors

motia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

quasar-app-extension-firebase-messaging's Issues

Quasar app v3 support ?

Hi,

I am trying to install this extension but it doesn't support @quasar/app v3.

Can you please give me some idea on how to install it?

Thanks !

Quasar v.2

Hi,

Great extension :-)
Can it be updated to be compatible with the new Quasar v 2?

more examples

Can you please to help setup a full example ?

Thanks

firebase-messaging-sw.js in subfolder?

Hi, thanks for this awesome work.

I was integrating this and found the error after build, because the app trying to find firebase-messaging-sw.js in root, but my app in subfolder.

Here the app url: domain.com/my-app

How can I solve this?

v1 support?

I am trying to use this with V1, but I am getting an error. Does it work with Quasar V1?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.