rtCamp / pwa-extension

Enables PWA features such as add to homescreen, offline reading features.
3 stars 2 forks source link

[PWA] Push notification plugins support #3

Open pradeep910 opened 4 years ago

pradeep910 commented 4 years ago

Overview

There are multiple third-party plugins available for Push notifications. Such as Izooto, Onesignal See the complete list here - https://www.wpexplorer.com/wordpress-push-notification-plugins/ We need to add a support for these plugins/services.

Goal

Have an option on plugin settings page where user can select which push notification service to use. Either OneSignal or iZooto or some other.

Tasks

**updated

pradeep910 commented 4 years ago

@deepaklalwani97

Pls check this plugin and see how it works - https://wordpress.org/plugins/progressive-wp/

deepaklalwani97 commented 4 years ago

@deepaklalwani97

Pls check this plugin and see how it works - https://wordpress.org/plugins/progressive-wp/

I have checked this plugin it is based on some older versions of the PWA plugin. It provides features like offline page access, push notifications with firebase and integration with one signal plugin but had lot of issues like it uses older hooks to register script which might make extensions using new hooks incompatible and the integration with one signal does not work properly and had some errors.

deepaklalwani97 commented 4 years ago

I tried to integrate izooto push notification service with the PWA plugin. The izooto provides very little control over which service worker to use in both the plugin and the manual integration method as it uses CDN to add its code for the service workers and SDK which results in conflict with the PWA plugin service worker. The solution for this could be to disable the parse request for URL which echoes the service worker code and the notifications work properly but doing this will throw some errors in the console as the izooto SDK expects the service worker code on that path. We will get an error like this Screenshot 2019-12-23 at 3 00 35 PM as we have disabled the parse request for that URL. This can be tested on a site I have created https://deepak-pwa.000webhostapp.com/

deepaklalwani97 commented 4 years ago

@pradeep910 I have checked how other push services send push notifications and mostly all of them use a separate server for push notifications and do not store the user's subscription data in the user's database. And if agree with your point if a site has large number of subscribers say 50000 or something it will create a load on users site to avoid that we can use a separate notification server or some service like firebase to store subscription data and send push notifications.

CC: @chandrapatel