# How to send push notifications from Bubble

- Tool: Bubble
- Difficulty: Beginner
- Time required: 20-25 min
- Compatibility: All Bubble plans (OneSignal plugin required)
- Last updated: March 2026

## TL;DR

Manage push notification delivery in your Bubble app by segmenting audiences, scheduling sends, handling delivery failures, and tracking open rates. This tutorial covers configuring a push notification service like OneSignal, sending targeted notifications from backend workflows, and building an admin dashboard to monitor engagement.

## Overview: Handling Push Notifications in Bubble

Push notifications keep users engaged even when they are not actively using your app. This tutorial shows how to integrate OneSignal for web and mobile push notifications, create audience segments, schedule deliveries, and track performance — all managed from within your Bubble app.

## Before you start

- A Bubble account with an app ready to edit
- A OneSignal account (free tier available)
- The OneSignal plugin installed in your Bubble app
- Basic understanding of backend workflows

## Step-by-step guide

### 1. Set up OneSignal and install the Bubble plugin

Create a OneSignal account at onesignal.com. Create a new app and configure it for Web Push (enter your Bubble app URL). Copy the App ID and REST API Key. In Bubble, go to the Plugins tab, search for OneSignal, and install it. Enter the App ID in the plugin settings. For the REST API Key, set up an API Connector call with the key marked as Private.

**Expected result:** OneSignal is configured and the Bubble plugin is ready to send notifications.

### 2. Add the subscription prompt to your app

The OneSignal plugin automatically adds a subscription prompt when users visit your app. Customize the prompt text in your OneSignal dashboard under Settings, then Web Push, then Permission Prompt. Choose between a slide prompt (recommended — less intrusive) or the native browser prompt. Add a custom state to track whether the current user has subscribed.

> Pro tip: Trigger the subscription prompt after the user has engaged with your app (e.g., after completing onboarding) rather than on first visit for higher opt-in rates.

**Expected result:** Users see a permission prompt and can subscribe to push notifications.

### 3. Create audience segments for targeting

In OneSignal's dashboard, go to Audience, then Segments. Create segments based on user behavior: Active Users (last session less than 7 days), Inactive Users (last session more than 30 days), and Premium Users (tag premium equals true). In Bubble, when a user performs key actions, use the API Connector to update their OneSignal tags via the REST API.

**Expected result:** Users are categorized into segments based on their behavior and subscription level.

### 4. Build a notification sending workflow

In the API Connector, create a call named Send Notification. Set method to POST, URL to https://onesignal.com/api/v1/notifications. Add headers: Authorization with your REST API Key (Private) and Content-Type as application/json. The body includes app_id, included_segments (or include_player_ids for individual users), headings, and contents. Use this call in a backend workflow to send notifications programmatically.

```
{
  "app_id": "YOUR_ONESIGNAL_APP_ID",
  "included_segments": ["Active Users"],
  "headings": {"en": "New Feature Available"},
  "contents": {"en": "Check out our latest update!"},
  "url": "https://yourapp.com/updates"
}
```

**Expected result:** A backend workflow that sends push notifications to targeted segments or individual users.

### 5. Schedule notifications for optimal delivery

Add a scheduling interface on your admin page with a Date Picker for send time, a Dropdown for segment selection, and inputs for notification title and message. When the admin clicks Schedule, create a NotificationSchedule record and use Schedule API Workflow to trigger the send notification workflow at the specified time. Display upcoming scheduled notifications in a Repeating Group.

**Expected result:** Admins can schedule notifications for future delivery and see a queue of upcoming sends.

### 6. Build a delivery tracking dashboard

Create an admin page showing notification performance. Use the OneSignal REST API to fetch notification statistics: total sent, delivered, opened, and clicked. Create an API Connector call to GET https://onesignal.com/api/v1/notifications with your app_id. Display the results in a Repeating Group showing each notification's title, send date, delivery rate, and open rate.

**Expected result:** An admin dashboard showing delivery and engagement metrics for all sent notifications.

## Complete code example

File: `API Connector payload`

```json
{
  "api_name": "OneSignal API",
  "authentication": "Private key in header",
  "header_key": "Authorization",
  "header_value": "Basic YOUR_REST_API_KEY",
  "calls": [
    {
      "name": "Send Notification",
      "use_as": "Action",
      "method": "POST",
      "url": "https://onesignal.com/api/v1/notifications",
      "headers": {
        "Content-Type": "application/json"
      },
      "body": {
        "app_id": "YOUR_APP_ID",
        "included_segments": ["<segment_name>"],
        "headings": {"en": "<title>"},
        "contents": {"en": "<message>"},
        "url": "<click_url>"
      }
    },
    {
      "name": "Get Notification Stats",
      "use_as": "Data",
      "method": "GET",
      "url": "https://onesignal.com/api/v1/notifications?app_id=YOUR_APP_ID&limit=50",
      "response_sample": {
        "notifications": [
          {
            "id": "abc123",
            "headings": {"en": "New Feature"},
            "successful": 1500,
            "converted": 120,
            "completed_at": 1711600000
          }
        ]
      }
    }
  ]
}
```

## Common mistakes

- **Showing the permission prompt immediately on first visit** — Users who have not yet seen value in your app are likely to deny the prompt, and browsers remember this denial. Fix: Delay the prompt until after the user has engaged — for example, after completing a signup or using a key feature.
- **Sending too many notifications** — Users quickly unsubscribe or block apps that send excessive notifications, permanently reducing your reachable audience. Fix: Limit notifications to 1-2 per day maximum. Use segments to send relevant content to the right users.
- **Not including a click URL in notifications** — Without a URL, clicking the notification opens the browser but not a specific page, creating a confusing experience. Fix: Always include a url field in the notification payload pointing to the relevant page in your app.

## Best practices

- Delay the subscription prompt until users see value in your app
- Segment your audience and send relevant targeted notifications
- Limit notification frequency to 1-2 per day to prevent unsubscribes
- Always include a meaningful click URL in every notification
- Track delivery and open rates to optimize timing and content
- Use backend workflows for scheduled sends rather than frontend actions
- A/B test notification copy to improve engagement rates

## Frequently asked questions

### Is OneSignal free?

OneSignal has a free tier that includes unlimited web push subscribers and up to 10,000 email subscribers. Paid plans add features like advanced segmentation and priority support.

### Can I send push notifications to mobile apps built with Bubble?

Yes, if your mobile app is wrapped using a service that supports push notifications. OneSignal supports both web and mobile push with separate configuration.

### What happens if a user blocks notifications?

Once blocked at the browser level, you cannot re-prompt the user. They must manually re-enable notifications in their browser settings. This is why delaying the initial prompt is important.

### How do I personalize notification content?

Use OneSignal tags to store user attributes (name, plan type). Reference these tags in your notification content using OneSignal's tag substitution syntax.

### Can I send notifications from frontend workflows?

Technically yes via API Connector, but backend workflows are better for scheduled sends and bulk notifications since they run server-side independently.

### Can RapidDev help build a comprehensive notification system?

Yes. RapidDev can build multi-channel notification systems combining push, email, SMS, and in-app notifications with centralized preference management and analytics.

---

Source: https://www.rapidevelopers.com/bubble-tutorial/handle-push-notifications-in-bubble
© RapidDev — https://www.rapidevelopers.com/bubble-tutorial/handle-push-notifications-in-bubble
