WordPress plugin to send push notifications using Firebase Cloud Messaging (FCM) to websites, Android / iOS mobile apps. It sends push notifications using Firebase Cloud Messaging (FCM) using legacy or latest version of httpv1 Firebase api or users can select Onesignal / Progressier / webtoapp as push notification providers. It has REST API facility to integrate with native/hybrid Android / iOS mobile apps for push notifications. It has facility to generate PWA - Progressive Web App. This plugin is able to send push notification to more than 200,000 subscribers unlimited push notifications using background action scheduler.
https://wordpress.org/plugins/push-notification-for-post-and-buddypress/
Enable/Disable option in admin settings to send push notifications using Firebase httpv1 or Onesignal only for loggedin users.
Enable/Disable custom prompt with icon to subscribe/unsubscribe push notifications in front end in admin settings.
Choose Horizontal or Vertical custom prompt style and customize the text, color and button.
Enable/Disable Bell prompt icon to subscribe/unsubscribe notifications. Front end users will be able to subscribe to particular category like post, activity, comments, friendship request/accept, other options while subscribing for first time or if user wants to update subscribe options from bell prompt at any time it is needed.
Use shortcode [member name] and [group name] in push notification title and custom content to display user name in title/content in push notifications, similarly for BuddyPress group activities [group name] place holder is available to display group name in title/content in push notifications.
For front end users Shortcode [subscribe_PNFPB_push_notification] is available to Subscribe/Unsubscribe push notifications
Front end push notification menu is available for BuddyPress Front end users to subscribe/unsubscribe various push notifications according to their choices. This menu is available in user profile – settings area. For other users, shortcode is available to display subscription menu for Front end users to subscribe/unsubscribe various push notifications according to their choices.
It allows Scheduled Push notifications to send push notifications hourly(every hour), twice daily(2 times per day), daily, weekly as per WordPress CRON. It also provides option to schedule push notification in background using action scheduler, this will be useful to send notification more than 100000 subscribers simultaneously in background mode.
Push notification scheduling is available for On demand/One time, WordPress Post, BuddyPress activities, BuddyPress group activities and for BuddyPress comments.
REST API to connect mobile native/hybrid apps to send push notification from WordPress site to both mobile apps and WordPress sites.
Using this REST API WordPress site gets Firebase Push Notification subscription token from Mobile app(Android/Ios).
This allows to send push notifications to WordPress site users as well as to Native mobile app Android/ios users.
REST API url is https://wp-json/PNFPBpush/v1/subscriptiontoken
Android app code to integrate with this plugin
IOS app code to integrate with this plugin
Refer video tutorial under “How to use this plugin” section to configure Firebase options in plugin admin area.
This plugin has facility to generate Progressive Web App (PWA). It also supports Progressier PWA.
Go to plugin settings page to enable/disable PWA app and to customize PWA app with app name, app icon, app theme color, background color for PWA and list of pages to be included in offline cache for web app offline mode.
If server is NGINX and not able to create dynamic service worker file https://pnfpb_icpush_pwa_sw.js & PWA manifest json file https://pnfpbmanifest.json then go to plugin settings->nginx tab, enable static file creation option, it will create required static service worker file, PWA manifest json files in root folder. This option is applicable only if hosting/server is based on NGINX and not creating dynamic service worker file, manifest json files. By default, this plugin creates dynamic service worker file and PWA manifest json file.
This plugin uses Firebase Cloud Messaging to send push notification using Firebase registration credentials which is free of cost.
https://www.muraliwebworld.com
https://www.youtube.com/watch?v=02oymYLt3qo
New API to send push notification subscription from Native mobile apps like Flutter mobile app to WordPress backend and to send push notifications from WordPress to Native mobile app using Firebase.
Note:- All REST api code is already included in the code, below is only for reference as guide,
REST API using POST method, to send push notification in secured way using AES 256 cryptography encryption method to avoid spams
REST API url post method to send push notification
https://domainname.com/wp-json/PNFPBpush/v1/subscriptiontoken
Input parameters in body in http post method in Flutter APP,
token – it should be encrypted according to AES 256 cryptography standards,
Following is sample code in dart Flutter AES 256 encryption and hash generation using AES 256 cryptography to send push notification subscription token in encrypted manner to this plugin - WordPress backend
String strPwd = "16234hgJKLmllpdcd09b2bc37293"; //secret key generated in step 1 above
GlobalData.pushtoken = token.toString();
final iv = EncryptPack.IV.fromLength(16);
final key = EncryptPack.Key.fromUtf8(strPwd); //hardcode
final encrypter = EncryptPack.Encrypter(EncryptPack.AES(key, mode: EncryptPack.AESMode.cbc));
final encrypted = encrypter.encrypt(token.toString(), iv: iv);
var hmacSha256 = CryptoPack.Hmac(CryptoPack.sha256,ConvertPack.utf8.encode(strPwd)); // HMAC-SHA256
var hmacstring = hmacSha256.convert(ConvertPack.utf8.encode(token.toString()));
var encryptedsubscription = encrypted.base64+":"+iv.base64+":"+hmacstring.toString()+":"+hmacstring.toString();
Using secret key generated from step 1, enter secret key in flutter app code as below in push_notification_manager.dart file (attached link for lib folder),
store token in global variable for other user
Generate envrypted token as mentioned below using below coding (AES 256 cryptography encryption)
Once plugin receives this token, it will unencrypt using the secret key generate and compare hash code to confirm it is sent from Flutter app
It allows to Schedule Push notifications to send as per below schedule using WordPress CRON scheduler
hourly(every hour)
,twice daily(2 times per day)
, daily
, weekly
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.
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.
Go to plugin admin area on demand push notification to send one time notification or to schedule multiple one time notifications to start at different date and time or schedule multiple campaigns to start at different date and time with image to all subscribers
https://wordpress.org/plugins/push-notification-for-post-and-buddypress/
Following are steps to configure the plugin,