Nickersoft / push-fcm-plugin

Official Firebase Cloud Messaging plugin for Push.js v1.0 :fire:
https://pushjs.org
42 stars 13 forks source link

Sample #1

Closed ThomasPerraudin closed 7 years ago

ThomasPerraudin commented 7 years ago

Could you provide a full functional sample (with index.html, etc.) ?

Nickersoft commented 7 years ago

A full tutorial is going to be released soon in Net Magazine (ideally). However, until then, you can take a look at the demo repo I set up for that tutorial: https://github.com/Nickersoft/push-net-tutorial. A couple things to keep in mind with the demo though: all of my Firebase creds have been removed for privacy, so you'll have to fill that in with your own info. Additionally, Push and the FCM plugin are just in the base directory.. if you install via NPM or Bower, you'll want to make sure that the service worker files in the bin directories of those packages are accessible from the root of your server, in order to provide them global scope (so like https://example.com/serviceWorker.min.js). Also, you gotta use SSL on your site I believe.

ThomasPerraudin commented 7 years ago

Thank you that's a useful tutorial script. Althought I still encounter an error "Please ensure that 'messagingSenderId' is set correctly" although it is set ... I'm investigating.

Nickersoft commented 7 years ago

Are you just trying to run the code from that repo? As I said, it's missing configuration values.

ThomasPerraudin commented 7 years ago

Of course I updated the configuration with my values :-)

Nickersoft commented 7 years ago

And you're still getting an error?

ThomasPerraudin commented 7 years ago

It works ! Actually I had a technical problem with my editor. Everything works nicely. Thanks a lot for this very useful Push.js