How to instantiate Firebase Cloud Messaging in Angular2 / TypeScript / AngularFire2 ?
It's described here for JavaScript: https://firebase.google.com/docs/cloud-messaging/js/client
How to instantiate Firebase Cloud Messaging in Angular2 / TypeScript / AngularFire2 ?
It's described here for JavaScript: https://firebase.google.com/docs/cloud-messaging/js/client
There seems to be an import that is required:
The
firebase.messaging()
function takes the Firebase app instance as an optional parameter.To wire it up with
AngularFire2
, you could letAngularFire2
perform the app initialization and create the Firebase app instance and could then inject the app instance (into a service, for example) and pass it tofirebase.messaging()
like this:You'll need to setup the web app manifest that's mentioned in the article you referenced. That's something with which I am unfamiliar.