perfecty-push-wp icon indicating copy to clipboard operation
perfecty-push-wp copied to clipboard

Passive approach to subscribe to Notifications

Open rwngallego opened this issue 4 years ago • 8 comments

As described in the Passive approach here, we would like to have a dedicated section where the users can opt-in for Push Notifications. It will not open the pop up to the new visitors but instead they will be able to subscribe on demand.

rwngallego avatar Jun 01 '21 21:06 rwngallego

Hi @rwngallego any idea about how to implement this?

MocioF avatar Jul 05 '21 07:07 MocioF

Well, this is a not so simple question and basically there's nothing written in stone about it, however what we want to do is to offer the users the capability to subscribe on demand to different categories (WordPress categories maybe? or products? I don't know). I would leave it to your imagination, and basically we could experiment with different approaches, measure the user satisfaction, get feedback and iterate. So the sky is the limit! :)

As a tip, I would suggest that we don't over complicate the UI and offer a simple but effective way to achieve what we want. If there's any thought that comes to my mind I would write something here, otherwise feel free to experiment :)

rwngallego avatar Jul 06 '21 21:07 rwngallego

I was actually coming here just to suggest this.

The idea is to give multiple subscription choices (email, rss and push notifications)

Two extra choices

Hide bell - a checkbox similar to the current one, the standard one is just hidden Let users opt in manually (requires manual setup) - also a checkbox

Make a shortcode that gives a simple button, ofc they will look like the buttons in the current window, as an example, my primary color on the theme I am in now is green, and therefore the button would also be green. Example: [perfecty_notification_options text="Notification settings"]

Fallback text is the Bell title.

AndersMadsen avatar Aug 08 '21 11:08 AndersMadsen

Using a shortcode would be absolutely sufficient for my case. I could integrate the subscription at the right place instead of annoying the visitor on the landing page where news play only a minor part.

When I am asked for permissions (or see popups in general) out of the blue I usually hit "cancel" automatically.

Or maybe even easier: Provide an option to not show the popup but only the bell!

mwessen avatar Nov 13 '21 07:11 mwessen

I am curious abut the progress on this. I am already working on this for one of my sites, will share the progress here. However I was looking for javascript function to manually trigger register and unregister functions. Rest of the work is already done.

aamir2007 avatar Jan 11 '22 02:01 aamir2007

I have done some work in this regard, please check blow site with full implementation. https://starepisodes.net/

Current flow of work. By default notifications are disabled and user is asked to login when it clicks on Bell icon, after login, on Category and Single Post page user can individually subscribe to categories so that it only get notification of posts published in that specific category.

A custom database table is generated to hold user_id, term_id and taxonomy to keep record of user subscriptions. On post publish users are returned based on post category and sent notification.

Further a shortcode is added which shows users currently subscribed categories along with option to unsubscribe.

I had to make little bit changes to the perfecty-push-sdk.min.js file to include term_id and taxonomy along with register and unregister requests and some other minor changes like adding a global plugin to activate plugin from outside javascript.

Obviously the solution is not perfect but I want to present it here so that someone having better expertise can review it and implement this into main plugin.

Once you have taken a look at current working of this functionality on the website, let me know if you are interested, I can share my code here so it can be used to further improve the plugin.

Right now I am having two issues,

  1. when notifications are disabled on the browser, there should be a message for user explaining how he/she can allow notifications for browser settings.
  2. In current scenario there is no option for me to schedule notifications for users that are subscribed in specific category, in this case if there are more user subscribed to a category this could lead to heavy load onto server.

Regars, Aamir

aamir2007 avatar Jan 17 '22 13:01 aamir2007

Hi @aamir2007 I see two things here:

  • One is the passive approach which this ticket is about
  • Another one is the taxonomy, which we're already discussing in https://github.com/perfectyorg/perfecty-push-wp/issues/54

So moving forward, let's continue the taxonomy discussion in https://github.com/perfectyorg/perfecty-push-wp/issues/54 I'll copy your last comment as an input there.

rwngallego avatar Feb 07 '22 17:02 rwngallego

I'd like to jump in here. What I need is:

  • No notification bell icon (as it is annoying to me)
  • No default prompt

The user should subscribe via the builtin browser setting OR a custom button. But the custom button is not important to me.

simple solution Display after this number of visits could take the value -1 which means it will never show the prompt, but give users the option to manually subscribe via Browser.

more background info I know the manual browser subscription is something nobody ever uses. I'd like to use this for my twa/pwa app, so the android version will autosubscribe to push notifications. I am still awaiting feedback, if that is possible, though: https://github.com/GoogleChromeLabs/bubblewrap/issues/660

NicoHood avatar Mar 26 '22 21:03 NicoHood