FM BetterForms Docs
BF Editorfmbetterforms.com
Engineering Reference Docs
Engineering Reference Docs
  • BF Streaming Proxy
  • Updating the Helper File
  • Connection Trouble Shooting Guide
  • Software Testing - Overview
    • Types of Testing
    • UX/UI Checklist
      • Pages
        • Login 🔑
        • Pricing 💵
        • 404 🤷‍♂️
        • Contact Us ☎️
        • Sign Up 👋
        • FAQ ❓
        • Blog Post 🗞
        • Careers 💼
        • Team 👫
        • Cart 🛒
        • Press 📸
        • Search results 🔍
      • Elements
        • Avatar 😁
        • Badge 📛
        • Button 🖲️
        • Card 🃏
        • Table 📏
        • Icon 🌠
        • Text Field ⌨️
        • Toggle 🎛️
        • Loading ⏳
        • Modal 🎉
        • Tooltip 🛠
        • Search 🕵️‍♀️
        • Navigation 🧭
        • Radio 📻
        • Checkbox ☑️
        • Tabs 🗂
        • Toast 🍞
      • Flows
        • Submitting a form 📨
        • Making a payment 💳
        • Contacting support 🆘
        • Deleting account 🗑
        • Tracking progress 📈
        • Resetting password 🤫
        • Showing input error 🚨
        • Entering a promo code 🏷️
        • Saving changes 💾
        • Canceling subscription 🛑
      • Topics
        • Responsiveness 🎚
        • Typography 🔤
        • Dark mode 🌑
        • Accessibility 🚹
        • Colors 🎨
        • UX Writing ✏️
      • Brand
        • Logo 💠
        • Social Media 🔉
        • Typography 🔠
    • FM BetterForms - Quality Assurance
    • JavaScript Libraries
  • Rollbacks and Version Control
  • BF Server Proxy
  • Base code End of Life - 0.8.78-0.8111
  • Setting up Auth0
    • Introduction
    • Getting started
      • Creating a tenant
      • Creating Application
      • Additional customizations
        • Allowed Callback URLs
    • Creating a Database
      • Choosing different login options
        • Social Connections
        • Username and password (Auth0)
        • Creating new BF Users
        • Using Auth0 in an iFrame
        • Configuring FM BetterForms
        • Additional Notes
  • Create an S3 Bucket on AWS
  • ApexCharts - Getting started
  • BF Enterprise Documentation
    • Overview
      • Features
      • Overview Diagram
    • Requirements
    • Env File
    • Setting up the Server
      • Installation
      • Loading image to a local repository
      • Starting server
      • Restarting Policies
      • Scaling up
    • Hardware Recommendations
    • FM Credentials - Helper file
    • How it works
      • Development
      • Downloading environment data
  • BetterForms Error Pages API
    • Introduction
    • Dynamic Error Page
    • Static Error Page
    • Custom error pages
    • Custom error handlers
    • Error Code List
  • BF Streaming API
  • Creating a PWA
    • Introduction
    • Getting Started
      • Making it installable
      • Browser Support
      • Sending Push Notifications
      • Sending a Push Notification from the API Endpoint
      • Adding DOM Header Insertion to be Available for Offline Use
Powered by GitBook
On this page

Was this helpful?

  1. Creating a PWA
  2. Getting Started

Sending Push Notifications

NOTE: This page is obsolute due to API changes, see BF Team Support

PreviousBrowser SupportNextSending a Push Notification from the API Endpoint

Last updated 11 months ago

Was this helpful?

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.

{
    "actions": [{
        "action": "pwaPromptPushPermission",
        "options": {
            "idUser_calc": "window.vueapp.$store.state.auth.user.id"
        }
    }],
    "buttonClasses": "btn btn-info bg-blue-400",
    "styleClasses": "col-md-2",
    "text": "Prompt permission for push notifications",
    "type": "button"
}

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.