Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser notifications #693 #913

Open
wants to merge 10 commits into
base: release
Choose a base branch
from

Conversation

robertrosman
Copy link

@robertrosman robertrosman commented Apr 1, 2024

Added a plugin for browser notifications. Should be pretty straight forward, but a few notes.

  1. You need to generate vapid keys and add to the .env file. I added some notes in dotenv.example about how to generate and a warning not to change them once you go live.
  2. The service-worker.js script is served as a web view in order to access it at the root level (/service-worker.js). This is required by design of service workers, otherwise it will fail due to insufficient permissions/scope.
  3. I haven't really had the change to test it on mobile, since web push notifications only work with ssl encryption enabled (don't even think self signed certificates will work), and I haven't set it up locally.
  4. Every device needs to allow notifications individually, and there are some edge cases when denying notification that I've tried to demonstrate in the showcase.
  5. My recording software insisted to enable "Do not disturb" mode, by default the notifications should popup without interaction.

Link to showcase
showcase

@robertrosman robertrosman changed the title Browser notifications Browser notifications #693 Apr 1, 2024
@kennethjiang
Copy link
Contributor

Thank you so much for the PR. I was hoping that I could get it merged soon. But have been very swamped with a few big changes. I will come back to your PR later this month. Sorry about that!

@robertrosman
Copy link
Author

No problem @kennethjiang! You're doing a great job, keep it up 👍

@kennethjiang
Copy link
Contributor

kennethjiang commented Apr 26, 2024

Sorry again for the delay. Finally got a chance to try it today. I set .env as:

DEBUG=False
VAPID_PUBLIC_KEY=BNeav6iVhFmO6MxS7gOJO...TDtE
VAPID_PRIVATE_KEY=cLUg_s...YFrkwRI
VAPID_SUBJECT=support@obico.io

But when I launched the server, I saw this on the preference page:

Screenshot 2024-04-25 at 9 45 39 PM

So no webpush section is shown. Did I miss a step?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants