Published on December 14, 2016 by Chrome

Read the Firebase Cloud Messaging documentation: goo.gl/h3wBld

One of the coolest features to land in Chrome recently is the ability to send a user a push notification. These notifications may trigger in response to a user action or could just be used as a mechanism to notify the user when you launch some new content. Traditionally setting up push notifications has required a fair bit of JavaScript and Service Worker know-how. Thanks to polymerfire’s firebase-messaging element we can greatly simplify the process. Check out today’s episode as we cover the basics of setting up firebase-messaging and dispatching our first notification using CURL.

Sample Code
github.com/polymer/polycasts

Firebase Messaging on beta.webcomponents.org:
beta.webcomponents.org/element/firebase/polymerfire/firebase-messaging

Polycasts playlist: goo.gl/r5fsMq
Polymer Slack: bit.ly/polymerslack
Polymer G+: goo.gl/YC5Bsh

Subscribe to the Chrome Developers channel: goo.gl/OUF4e2

Leave a Reply

93 Comments on "Firebase Messaging — Polycasts #59"

Notify of
avatar

eeerrrttty
Guest
eeerrrttty
7 months 30 days ago

PLEASE @Rob Dodson, MAKE AN TUTORIAL SIMPLE FOR FIREBASE STORAGE WITH POLYMER!!!! This is a hell level difficult, we noobs always have trouble with this kind :(, if possible, things like, uploading and retrieving image of storage to view in html….THIS WOULD MOVE FORWARD THE POLYMER PROJECT!

SYS-T@M
Guest
SYS-T@M
3 months 25 days ago

yesss pleaseee

Chukkrit Visitsaktavorn
Guest
Chukkrit Visitsaktavorn
7 months 25 days ago

agree

eeerrrttty
Guest
eeerrrttty
7 months 30 days ago

PLEASE @Rob Dodson, MAKE AN TUTORIAL SIMPLE FOR FIREBASE STORAGE WITH POLYMER!!!! This is a hell level difficult, we noobs always have trouble with this kind :(, if possible, things like, uploading and retrieving image of storage to view in html….THIS WOULD MOVE FORWARD THE POLYMER PROJECT!

SYS-T@M
Guest
SYS-T@M
3 months 25 days ago

yesss pleaseee

Chukkrit Visitsaktavorn
Guest
Chukkrit Visitsaktavorn
7 months 25 days ago

agree

Ben Sisakht
Guest
Ben Sisakht
8 months 14 days ago

Hey Rob! Great Video as always! I'm kinda a newbie, just wondering if this would work on Safari (seems to work on desktop) and generally on iOS devices ?

Ben Sisakht
Guest
Ben Sisakht
8 months 14 days ago

Hey Rob! Great Video as always! I'm kinda a newbie, just wondering if this would work on Safari (seems to work on desktop) and generally on iOS devices ?

Keertikeya Gupta
Guest
Keertikeya Gupta
9 months 18 days ago

I wonder if I could use FCM to show in-app notifications rather than push notifications. Is there a way to achieve it?

Max Bachhuber
Guest
Max Bachhuber
8 months 11 days ago

You could use the handleMessage function. It is triggered when you receive a message.

Dean Martin
Guest
Dean Martin
9 months 27 days ago

Does this work when the browser is not open at all? Like native push?

Max Bachhuber
Guest
Max Bachhuber
8 months 11 days ago

Yes it does. This is what the service worker is for

Dean Martin
Guest
Dean Martin
9 months 27 days ago

Does this work when the browser is not open at all? Like native push?

Max Bachhuber
Guest
Max Bachhuber
8 months 11 days ago

Yes it does. This is what the service worker is for

Tevin Thuku
Guest
Tevin Thuku
1 year 20 hours ago

Thanks Rob For this tutorials. They are amazing 🙂

Tevin Thuku
Guest
Tevin Thuku
1 year 20 hours ago

Thanks Rob For this tutorials. They are amazing 🙂

phani1 kumar
Guest
phani1 kumar
1 year 4 days ago

Thank you Rob for all the great tutorials. How do we let the users unsubscribe from the messaging? ` this.$.userToken.destroy();` inside the else block of `toggleSubscription` doesn't work! I couldn't find any documentation of `firebase-messaging` that tells us how unsubscribe can be performed. Though the above statement deletes record from database, when the user refreshes page, it automatically subscribes without even asking the user whether they want to subscribe or not!Edit: Even after removing the service-worker registered, somehow the browser refresh brings back the subscription token kind of magically! I seriously need a way to unsubscribe.

phani1 kumar
Guest
phani1 kumar
11 months 3 days ago

Nope! my issue that I raised in github is left unanswered. github.com/firebase/polymerfire/issues/182

Slak Tary
Guest
Slak Tary
11 months 3 days ago

did you manage to find a solution ?

1 2 3 5
wpDiscuz