In this tutorial, you will learn how to configure Web Push Notifications in BuddyBoss Platform. This feature allows members to subscribe and receive all BuddyBoss notification types as push notifications through their browser, even when they’re not on your website.
Note: You need BuddyBoss Platform Pro installed, and Notification Type enabled in order for Web Push Notifications to work.
Connecting a OneSignal Account
First, you need to connect a OneSignal account to power the push notifications:
- Sign up for a Free account at OneSignal.
- While logged into OneSignal, click your profile icon, then click Account & API Keys.
- Scroll down to User Auth Key, and click Generate New User Auth Key. Save the key.
- In your WordPress site, navigate to BuddyBoss > Integrations > OneSignal
- Enter the OneSignal Auth Key you just generated and click Save Settings. The connection status should now display as “Connected”.
- Under Select App, click the + Create New App button to automatically create a new app in your OneSignal account and link it to your website. Alternatively, if you already have an app in OneSignal that you want to use, you can select it from the dropdown.
- Click Save Settings.
The screen will show Connected if the setup is successful.
Enabling Web Push Notifications
- Go to BuddyBoss > Settings > Notifications > Web Push Notifications.
- Mark/unmark the checkbox to enable/disable the Web Push Notifications.
- Upload Default Notification Icon. (Optional) Note: The icon needs to be a square icon. The recommended size is 300px by 300px.
- Mark/unmark the checkbox to enable/disable to Automatically Request Permission. When enabled, a prompt will be presented by the browser, requesting permission for the site to send web push notifications. The member must click “Allow” to be subscribed. If disabled, members will need to allow permission in the Notification Preferences tab of their Account Settings.
- Mark/unmark the checkbox to enable/disable the Soft Prompt. You can enable “soft prompt” which you can customize with additional content to persuade members to subscribe to your website push notifications. The “soft prompt” will trigger the above “hard prompt” if the member clicks “Allow”.
- Click the Save Settings button.
Once everything is set up, members can toggle on and off the option to receive web push notifications from their Account > Notification Preferences page on the website frontend.
Users can mark/unmark any Web notification type’s checkbox to enable/disable that notification type from being sent as a web push notification. They can also click the toggle at the bottom of the page to enable/disable web push notifications for your website for the browser they are currently viewing the site from.