bpolaszek/webpush-bundle

Anonymous users

Closed this issue · 3 comments

I suggest changing the code to allow anonymous users to subscribe through this library as well.
Mostly would require changing type hints.

Hi @merphidos, the purpose of this library is to associate webpush subscriptions to application users. The goal is to pick a user and send them a notification on all the browsers they're subscribed. I'm afraid integrating anonymous users is irrelevant here. What is your use case?

Hi @bpolaszek. I'm using your library to associate subscriptions with users when there's someone logged in. However, most of our customers do not log in so subscription should be available to anonymous users as well. I asked for this because there maybe others who are in this situation and since lib is in php 7.2 with type hints and such, you need to hack a bit for it to work with anonymous users.
Anyways, I figured it out for our case, so this was more of a suggestion rather than help request.
Thank you. 👍

@bpolaszek I have a similar request, my use case is:

My site is a simple blog. There are no users/logins as the site content is purely news/announcements about the project. I would like anonymous users to be able to subscribe to receive notifications when a new announcement is posted or updated.

@merphidos do you remember how you solved this in the end?