Push Notification for Post and BuddyPress

Descripción

This Plugin is designed to send push notification using Firebase Cloud Messaging whenever new WordPress post published, WordPress custom post types published and for new BuddyPress activities and also for comments posted in BuddyPress activities. It also generates PWA – Progressive Web App with offline mode facility based on setting from plugin admin page.

Plugin features:-
To send/schedule Push notifications when new item is published for following,
1. New post/custom post type published
2. New BuddyPress activities published
3. New BuddyPress group activity published
4. New Buddypress comments published
5. New BuddyPress message sent

Firebase configuration setup in plugin admin settings

  1. Sign in to Firebase, then open your project, click settings icon & select Project settings

To get Firebase server key (for field 1 in admin firebase settings)

  1. project settings > cloud messaging tab > get server key or add server key button to get server key

To get Firebase config fields (for fields 2 to 8 in admin firebase settings)

3.If you do not have web app, Create a new web app. After creating a new app, it will show firebase config fields
Project settings > General under your apps section > click on config button to view configuration fields

To get Firebase public key (for field 9 in admin firebase settings)

  1. Open the Cloud Messaging tab of the Firebase console Settings pane and scroll to the Web configuration section.
    In the Web Push certificates tab, click Generate Key Pair. The console displays a notice that the key pair was generated, and displays the public key string and date added.
    (If you already Generated key pair then no need to generate it again)

Scheduling push notification

It allows Scheduled Push notifications to send push notifications hourly(every hour), twice daily(2 times per day), daily, weekly as per WordPress CRON.
For BuddyPress messages push notification will be sent only to particular user sent by sender id
It uses Firebase Cloud Messaging to send push notification using Firebase registration credentials which is free of cost.
Firebase PUSH API is not compatible with Safari browsers and push notification using firebase push api will not work in Safari browsers. For Safari browsers,this plugin will display console log messages to indicate the browser is not supported for push api.
This plugin automatically clears out device tokens which are not subscribed or if user unsubscribed from the browser then that token will be automatically deleted.
Service workers are created on the fly for Firebase Cloud Messaging while activating the plugin
In addition to default subscription from browser, following shortcode can also be used to display toggle subscription button.
New Shortcode [subscribe_PNFPB_push_notification] to display Subscribe/Unsubscribe push notification toggle button.
Using above shortcode, toggle button to subscribe/unsubscribe can be added to sidebar or any other locations according to your need.
The shortcode [subscribe_PNFPB_push_notification] is optional, it is a additional facility to subscribe to push notification inaddition to default option from browser.

Progressive Web App (PWA)

This plugin generates PWA app based on settings in plugin admin area. Admin users will be able to enable/disable PWA app and will be customize PWA app with app name, app icon, app theme color, background color and list of pages to be included in offline cache for web app offline mode. If pages are included for offline cache then users will be able to view those pages in offline mode without internet if page is not stored in cache then default offline page will be displayed. Progressive Web Apps are supported by Chrome(Desktop,Mobile) browser, Edge browser, Firefox for android, Opera for android. Firefox for desktop will not support PWA.

How to use Plugin:-

Following are steps to configure the plugin,
1. Download the plugin
2. Activate the plugin
3. Go to settings of the plugin (in admin menu -> Settings -> Push Notification using FCM)
4. Enable/Disable push notification when new item published in following,
4.a. new post types published,
4.b. new custom post types published,
4.c. BuddyPress activities,
4.d. BuddyPress Group members,
4.e. BuddyPress messages,
4.f. BuddyPress comments

Scheduling push notifications

5.Optionally it allows to Schedule push notifications for post types,BuddyPress new activities, BuddyPress new Group activities and for BuddyPress new comments. Push notifications can be scheduled in following schedules. Go to admin settings and schedule it accordingly.Schedule push notifications in Hourly, twice daily,daily,weekly schedules. If schedule is off then push notification will be sent whenever new item is published in corresponding post types/BuddyPress activities/messages/comments.
6.When BuddyPress Group Members option is enabled, it will send push notification only to users who joined in Group/to Particular group members.
7.When Buddypress private message notification is enabled, Private message notification will be sent only to the recipient id sent by sender. Admin can customize the text for push notification title from admin options.

  1. Configure Firebase settings as per below steps,

Firebase configuration setup in plugin admin settings

8.1. Sign in to Firebase, then open your project, click settings icon & select Project settings

To get Firebase server key (for field 1 in admin firebase settings)

8.2. project settings > cloud messaging tab > get server key or add server key button to get server key

To get Firebase config fields (for fields 2 to 8 in admin firebase settings)

8.3.If you do not have web app, Create a new web app. After creating a new app, it will show firebase config fields
Project settings > General under your apps section > click on config button to view configuration fields

To get Firebase public key (for field 9 in admin firebase settings)

8.4. Open the Cloud Messaging tab of the Firebase console Settings pane and scroll to the Web configuration section.
In the Web Push certificates tab, click Generate Key Pair. The console displays a notice that the key pair was generated, and displays the public key string and date added.
(If you already Generated key pair then no need to generate it again)

Progressive Web App (PWA) settings

  1. Go to PWA settings in plugin admin area and fill all required fields to customize and generate PWA app with offline facility.If pages are included for offline cache then users will be able to view those pages in offline mode without internet if page is not stored in cache then default offline page will be displayed.

After saving below fields, it will ask to allow notification for this website in browser default popup, click on allow notification to get notifications

Push notifications will better work in normal browser not in cognito private browser as it requires service worker registrations to display push notification.

After completing above steps, push notification will be displayed based on option selected for posts/buddypress while publishing posts or custom post types or during new BuddyPress activities or comments.

  1. New Shortcode [subscribe_PNFPB_push_notification] can also be used to display Subscribe/Unsubscribe push notification toggle button. It is a additional facility in addition to default option from browser to subscribe/unsubscribe push notifications.

  2. Go to on-demand push notification admin panel to send push notification from admin panel to all subscribers whenever it required.

Capturas

  • Screen showing list of push notifications in desktop
  • Settings page to configure plugin with FireBase and other settings
  • Admin area menu for this plugin
  • Shortcode to display subscribe/unsubscribe toggle button
  • Shortcode to display unsubscribe/subscribe toggle button
  • BuddyPress Group members can subscribe/remove push notification for every group
  • Admin page showing list of tokens subscribed
  • Progressive Web App admin settings page

Instalación

Following are steps to configure the plugin,
1. Download the plugin
2. Activate the plugin
3. Go to settings of the plugin (in admin menu -> Settings -> Push Notification using FCM)
4. Enable/Disable push notification when new item published in following,
4.a. new post types published,
4.b. new custom post types published,
4.c. BuddyPress activities,
4.d. BuddyPress Group members,
4.e. BuddyPress messages,
4.f. BuddyPress comments

Scheduling push notifications

5.Optionally it allows to Schedule push notifications for post types,BuddyPress new activities, BuddyPress new Group activities and for BuddyPress new comments. Push notifications can be scheduled in following schedules. Go to admin settings and schedule it accordingly.Schedule push notifications in Hourly, twice daily,daily,weekly schedules. If schedule is off then push notification will be sent whenever new item is published in corresponding post types/BuddyPress activities/messages/comments.
6.When BuddyPress Group Members option is enabled, it will send push notification only to users who joined in Group/to Particular group members.
7.When Buddypress private message notification is enabled, Private message notification will be sent only to the recipient id sent by sender. Admin can customize the text for push notification title from admin options.
8. Configure Firebase settings as per below steps,

Firebase configuration setup in plugin admin settings

8.1. Sign in to Firebase, then open your project, click settings icon & select Project settings

To get Firebase server key (for field 1 in admin firebase settings)

8.2. project settings > cloud messaging tab > get server key or add server key button to get server key

To get Firebase config fields (for fields 2 to 8 in admin firebase settings)

8.3.If you do not have web app, Create a new web app. After creating a new app, it will show firebase config fields
Project settings > General under your apps section > click on config button to view configuration fields

To get Firebase public key (for field 9 in admin firebase settings)

8.4. Open the Cloud Messaging tab of the Firebase console Settings pane and scroll to the Web configuration section.
In the Web Push certificates tab, click Generate Key Pair. The console displays a notice that the key pair was generated, and displays the public key string and date added.
(If you already Generated key pair then no need to generate it again)

Progressive Web App (PWA) settings

  1. Go to PWA settings in plugin admin area and fill all required fields to customize and generate PWA app with offline facility.If pages are included for offline cache then users will be able to view those pages in offline mode without internet if page is not stored in cache then default offline page will be displayed.

  2. Go to on-demand push notification admin panel to send push notification from admin panel to all subscribers whenever it required.

After saving below fields, it will ask to allow notification for this website in browser default popup, click on allow notification to get notifications

Push notifications will better work in normal browser not in cognito private browser as it requires service worker registrations to display push notification.

After completing above steps, push notification will be displayed based on option selected for posts/buddypress while publishing posts or custom post types or during new BuddyPress activities or comments.

  1. New Shortcode [subscribe_PNFPB_push_notification] can also be used to display Subscribe/Unsubscribe push notification toggle button. It is a additional facility in addition to default option from browser to subscribe/unsubscribe push notifications.

Preguntas frecuentes

Do you have any questions?

Please contact us here with your query.
(or) Submit your question in plugin forum

Reseñas

10 de abril de 2020
This Plugin does not work. It has the potential to be something better. I hope the developer can make this better.
Leer todas las 3 reseñas

Colaboradores y desarrolladores

Este software es de código abierto. Las siguientes personas han contribuido a este plugin.

Colaboradores

Registro de cambios

1.24

To fix array problem related in removing unsubscribed users based on firebase push notification result.

1.23

Changes to avoid conflict with other Firebase based plugins

1.22

Updated with detailed procedure to set up firebase configuration in plugin admin area and in plugin page

1.21

  • New feature added in admin plugin settings panel to send custom or on-demand or one time push notification from plugin admin panel to all subscribers.
    Added exclude urls option in PWA admin settings page. List of urls entered in this options are excluded from offline cache from service worker. New feature to generate Progressive Web App (PWA) with offline facility.

1.20

New feature to generate Progressive Web App (PWA) with offline facility.
Go to plugin admin area PWA settings to activate PWA Progressive Web App facility
Fix to use push notifications for wordpress sites installed in sub folders.
Modified version of plugin admin settings pages.

1.19

To fix problem related to delete device token in admin settings.New features to schedule push notifications and new admin option to manage subscribed device tokens list for push notifications.

1.18

New features to schedule push notifications and new admin option to manage subscribed device tokens list for push notifications
if schedule check box is ON then admin can schedule push notification in hourly/twicedaily/daily/weekly schedules
Schedule push notification is applicable to post types, BuddyPress new activities/new group activities/new comments posted for BuddyPress activities.

1.17

New features to schedule push notifications and new admin option to manage subscribed device tokens list for push notifications
if schedule check box is ON then admin can schedule push notification in hourly/twicedaily/daily/weekly schedules
Schedule push notification is applicable to post types, BuddyPress new activities/new group activities/new comments posted for BuddyPress activities.
Go to admin settings and schedule push notification accordingly. If schedule is off then push notifications will be sent whenever new item is posted according to option settings

1.16

New feature to clear outdated device tokens which are un-subscribed or if user un-subscribed from the browser then that token will be automatically deleted to avoid duplicates.
Private message notifications from sender only to user who subscribed. User id will automatically updated with device token when user logged in and already subscribed to push notifications.

1.15

Bug fixes related to update userid when user logged in for device already subscribed.
New feature to clear outdated device tokens which are not subscribed or if user un-subscribed from the browser then that token will be automatically deleted to avoid duplicates.
New features added to send push notifications for private messages in BuddyPress only to receiver’s id.

1.14

New feature to clear outdated device tokens which are not subscribed or if user un-subscribed from the browser then that token will be automatically deleted to avoid duplicates.
New features added to send push notifications for private messages in BuddyPress only to receiver’s id.
Bug fix to update userid when user logged in for device already subscribed.

1.13

New features added to send push notifications for private messages in BuddyPress only to receiver’s id.
When Buddypress private message notification is enabled, Private message notification will be sent only to the recipient id sent by sender. Admin can customize the text for push notification title from admin options.
Foreground push notification in android browser when browser is in focus along with background push notification(which is already in old release).
Compatible upto WordPress 5.8.1 and blocks.

1.12

Removed alert dialogs for service worker registration failed, replaced with console logs.
Firebase PUSH api will work in Chrome,Edge,Firefox and other major browsers except Safari.
Firebase PUSH API is not compatible with Safari browsers and push notification using firebase push api will not work in Safari browsers.
For Safari browsers,this plugin will display console log messages to indicate the browser is not supported for push api.

1.11

Changes to BuddyPress Group member push notification subscription/unsubscription.
Changes to Compatiable with buddyx theme, buddypress template packs – legacy and BuddyPress Nouveau.
Fixed – Push Notification permission to ask only with user gesture and removed request permission without user gesture

1.10

New feature added – BuddyPress Group members can subscribe/remove push notification for every group.
When BuddyPress Group Members option is enabled, it will send push notification only to users who joined in Group/to Particular group members.

1.9

Compatible upto WordPress Version 5.6

1.8

New feature added – BuddyPress Group members can subscribe/remove push notification for every group.
When BuddyPress Group Members option is enabled, it will send push notification only to users who joined in Group/to Particular group members.
Compatible upto WordPress Version 5.6

1.7

Fixed warnings related to sourcemapping firebase core javascript
Updated firebase core modules
Push notifications will better work in normal browser not in cognito private browser as it requires service worker registrations to display push notification.
This plugin requires firebase credentials to be filled in plugin admin area to get push notifications from FireBase. Please refer plugin documentation
Updated subscribe and unsubscribe javascript files compatible with latest jquery

1.6

Updated firebase core modules
Compatible upto WordPress Version 5.5.1. Updated author URL.

1.5

Compatible upto WordPress Version 5.5.1. Updated author URL.

1.4

Compatible upto WordPress Version 5.4.2. Updated author URL.

1.3

Compatible and tested upto WordPress Version 5.4.2

1.2

  • Added new shortcode [subscribe_PNFPB_push_notification] to unsubscribe push notifications.
  • Removed manifest.json file generation as it is required by old generation.

1.1.1

  • Added new shortcode [subscribe_PNFPB_push_notification] to unsubscribe push notifications.
  • Removed manifest.json file generation as it is required by old generation.

1.1

  • Updated with link to the settings on the Plugins screen.

1.0

  • Initial version.