Add support for path to schema

Created on 30 July 2024, 5 months ago

In the database you have the defined the wpn_subscription entity with the wpn_subscriptions table that has the following fields:

  1. id (int),
  2. key(string),
  3. token(string),
  4. endpoint (string), and
  5. created (timestamp)

I would like to add support for path as well.

This would allow for multiple paths per subscription, so a user could have a cta on the /news section as well as the /sports section etc.
An event could be fired on node publish and if path pattern fits with a section they have subscribed to user can be sent the notification.

Conversely, if they have subscribed to notifications but not the path, nothing will be sent.

This would allow users to subscribe to interest in relevant content or section denoted by path

Once https://www.drupal.org/project/web_push_notification/issues/3464691 Toggle between click Window on load and on click notifications Active has been implemented, it would also allows for users to subscribe to one or more sections.

Only issue I see with this is that in order to see if user has already subscribed to path, some data will likely need to be exposed on the back end (Drupal) to anonymous users if they have already accepted site/domain notifications. I think we should be able to return an array of paths based on the users web token.

If user has accepted site wide notifications, but not accepted notifications for the path, then they should see a CTA asking if they would like to be sent notifications for this page.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom 2dareis2do

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024