Sending Push Notifications
NOTE: This page is obsolute due to API changes, see BF Team Support
Last updated
NOTE: This page is obsolute due to API changes, see BF Team Support
Last updated
With PWA support, you can send push notifications to users, allowing your web app to engage with them. To request push notification permissions from users, we have an action that triggers the browser's 'ask for permission' prompt. This can be used at relevant and convenient points throughout your web app.
The example below shows how we could trigger the permission prompt from a button on a page.
In this example, we set the user ID (BetterForms ID) as a key to target this when sending a push notification. Clicking on the button will display the following prompt.
Once the user clicks on Allow
, the subscription will be saved in the BF cloud database and you will be able to send a push notification to the user using either an action from the frontend or hitting our /pushdata/sendnotification
endpoint, as shown below.