xtrinch / fcm-django-web-demo

Quick demo to demonstrate the use of firebase web push notifications with the use of `javascript` on frontend, `django` on backend and push notifications via `fcm-django` pypi package for django.
74 stars 52 forks source link

README update and HTTPS support #2

Closed Pymancer closed 7 years ago

Pymancer commented 7 years ago

just some readme additions and https support (in case developer can't use localhost)

xtrinch commented 7 years ago

Looks okay, but I'm afraid I cannot just merge this, because it is making usage particulary complicated with certificate generation and all, for people who just want to run a http version on localhost.

I believe readme should primarily contain the easy version, then an addition for the https version.

Also help me clear one thing that is unclear to me - what would be the use case / benefits of running this on https and what is the actual setup when one could not use localhost?

Another thing is I tried following your readme step by step, ofcourse setting it up on localhost, and after requesting permission for firebase to send me notifications, I ran into the following error, after which I could not send myself notifications:

"Failed to register a ServiceWorker: An SSL certificate error occurred when fetching the script."

Pymancer commented 7 years ago

Also help me clear one thing that is unclear to me - what would be the use case / benefits of running this on https and what is the actual setup when one could not use localhost?

In my case all sources are on the headless server outside of my full control with entirely different environment in comparison to my local system so usually it's much easier for me to run everything there.

"Failed to register a ServiceWorker: An SSL certificate error occurred when fetching the script."

I think it's Chrome being somewhat overprotective in this case (for development), you can try to run it with --ignore-certificate-errors flag. Working mostly in Firefox myself :-).

I believe readme should primarily contain the easy version, then an addition for the https version

Can't disagree with you! Anyway, I'll soon create a new pull request with the localhost edition and additional notes about https version in README. Closing this one.