Overview
This guide demonstrates how to implement native push notifications in your Webflow + Wized web application using Despia. Unlike web push notifications that have limitations and require workarounds, native push notifications provide full capabilities including deep linking, badge counts, custom sounds, and more.
Prerequisites
-
A Webflow website integrated with Wized
-
Despia account with your app configured
-
OneSignal account (free tier is sufficient)
-
Apple Developer account (for iOS)
-
Google Play Console account (for Android)
-
Firebase project (for Android)
Setting Up OneSignal
Create OneSignal Account
-
Sign up for a free OneSignal account at onesignal.com
-
The free tier includes unlimited push notifications with GDPR compliance
-
Paid features include email marketing and SMS (not required for push notifications)
Create New App in OneSignal
-
In the OneSignal dashboard, click "New App"
-
Enter your app name and organization
-
Select iOS platform first (we'll add Android later)
iOS Configuration
Generate P8 Key
Important: Use Apple Developer portal, NOT App Store Connect.
-
Go to developer.apple.com
-
Navigate to Certificates, IDs & Profiles → Keys
-
Click the + button to create a new key
-
Name your key (e.g., "OneSignal MyApp")
-
Enable Apple Push Notification service (APNs)
-
Configure the environment:
- Select both Sandbox and Production
-
Click Continue → Register
-
Download the key immediately (you can only download it once!)
-
Save the .p8 file securely
Configure OneSignal for iOS
-
Upload the .p8 file to OneSignal
-
Enter the Key ID (found in Apple Developer portal next to your key)
-
Enter the Team ID (shown next to your company/personal name in Apple Developer)
-
Enter the Bundle ID:
-
Find this in Despia dashboard under Publish App
-
Copy your bundle ID
Note: To use a custom bundle ID without Despia branding, contact support.
-
-
Click Save & Continue
-
Select Native iOS (Despia creates true native apps!)
-
Save & Continue
Add iOS App ID to Despia
-
Copy the OneSignal App ID
-
In your Despia project editor, scroll to OneSignal Integration
-
Paste the App ID in iOS Application ID field
-
Save and publish your project
Android Configuration
Create Firebase Project
-
Go to Firebase Console
-
Important: Log in with the same Google account linked to your Google Play Console
-
Create a new project with your app name
-
Wait for project setup to complete
Enable Firebase Cloud Messaging
-
In Firebase project settings, go to Cloud Messaging
-
Ensure Firebase Cloud Messaging API v1 is enabled
-
If disabled:
-
Click the three dots → Open in Cloud Console
-
Click Enable
-
Generate Service Account Key
-
Go to Project Settings → Service Accounts
-
Click Generate New Private Key
-
Download the JSON file and save it securely
Configure OneSignal for Android
-
In OneSignal, go to Settings → Push → Push Platforms
-
Click Add Android
-
Upload the Google Service Account JSON file
-
Click Save & Continue
-
Select Native Android
-
Save & Continue
Add Android Configuration to Despia
The OneSignal App ID remains the same for both platforms. In Despia:
-
Add the same App ID to Android Application ID field
-
Save and publish your project
Testing Push Notifications
iOS Testing
-
Install your app via TestFlight
-
Open the app to register the device
-
In OneSignal dashboard:
-
Go to Audience → Subscriptions
-
Verify your device appears
-
-
Send a test message:
-
Click New Message
-
Select segments: Active Subscriptions or Total Subscriptions
-
Add title, subtitle, and message
-
Click Send
-
Android Testing
-
Install your app from Google Play Console
-
Open the app to register
-
Test similarly to iOS
Note: Android devices may show "user didn't opt in" due to manufacturer variations, but notifications typically still work.
Setting Up Push Notifications in Wized
Create Variables in Wized
-
Open your Wized editor
-
Go to the Data Store → Variables
-
Create a new variable:
-
Name:
onesignalplayerid
-
Type: Text
-
Initial Value: (leave empty)
-
Capture Player ID on Page Load
Create a workflow to capture the OneSignal Player ID when your app loads:
-
Create a new Event in Wized:
-
Name:
Set OneSignal Player ID (Native
) -
Trigger: Page finishes loading
-
-
Add an Action:
-
Type: Set Variable
-
Variable:
onesignalplayerid
-
Value (JavaScript):
return window.onesignalplayerid || "sample-player-id"
-
Note: Despia automatically injects the
onesignalplayerid
variable into your application. The fallback "sample-player-id" helps during development in the Wized editor.
Associate Player ID with User
After capturing the Player ID, send it to your backend:
-
In the same workflow, add another action after setting the variable:
-
Type: Perform Request
-
Select your API endpoint to store the Player ID
-
Send:
-
onesignalplayerid
: The OneSignal Player ID variable -
userid
: Your authenticated user's ID
-
-
Store Player IDs in Your Database
Create a linking table in your database:
player_devices
- id (primary key)
- user_id (foreign key to users table)
- player_id (OneSignal Player ID)
- device_type (iOS/Android)
- created_at
- last_active
- This is an example only, the implementation will depend on your backend provider and your current database schema.
Sending Targeted Push Notifications
Backend Implementation
Use OneSignal's REST API to send notifications to specific users:
curl -X POST https://onesignal.com/api/v1/notifications \
-H "Content-Type: application/json; charset=utf-8" \
-H "Authorization: Basic YOUR_REST_API_KEY" \
-d '{
"app_id": "ONESIGNAL-APP-ID",
"include_player_ids": ["PLAYER-ID"],
"headings": {"en": "Hello"},
"contents": {"en": "This is a test notification from Despia"}
}'
Implementation in Xano
-
Create a new API endpoint in Xano
-
Add an External API Request function
-
Import the cURL command above
-
Make it dynamic:
-
Query user's player IDs from your database
-
Insert them into the
include_player_ids
array -
Customize the message content
-
Security Best Practices
-
Store OneSignal REST API key as environment variable
-
Never expose API keys in frontend code
-
Use server-side logic for all push notification triggers
Advanced Features
Deep Linking
Add a URL to open specific pages in your app:
{
"url": "https://yourapp.com/orders/12345",
}
Badge Management
Set or increment badge counts:
{
"ios_badgeType": "SetTo",
"ios_badgeCount": 5
}
Testing Your Implementation
iOS Testing
-
Publish your Despia app
-
Install via TestFlight
-
Open the app to register the device
-
Check OneSignal dashboard → Audience → Subscriptions
-
Send test notification from OneSignal or your backend
Android Testing
-
Publish your Despia app for Android
-
Install from Google Play Console (internal testing)
-
Open the app to register
-
Test notifications (ignore any "user didn't opt in" errors - common with Android)
Debugging Tips
Display Player ID in Development
For testing, temporarily add an input field to display the Player ID:
-
In Webflow, add a form with an input field
-
Add custom attribute:
wized="sample-player-id-input"
-
In Wized, bind the input value to your
onesignalplayerid
variable
Common Issues
Player ID not captured:
-
Ensure the app is opened fresh (close all tabs first)
-
The OneSignal SDK must initialize on app launch
Notifications not received on Android:
-
Samsung and other manufacturers may show false errors
-
Test sending anyway - usually works despite error messages
Targeting wrong platform:
-
When creating new push campaigns after adding a platform, create fresh messages
-
Don't clone old messages - they may only target the original platform
Implementation Workflow Summary
Setup Phase
-
Configure OneSignal for iOS and Android
-
Add OneSignal App ID to Despia
-
Publish your Despia app
Integration Phase
-
Create Wized variable for Player ID
-
Capture Player ID on page load
-
Send to backend with user authentication
Backend Phase
-
Store Player IDs linked to users
-
Implement push notification endpoints
-
Use OneSignal API for targeted sends
Testing Phase
-
Test on real devices
-
Verify player registration
-
Send test notifications
Benefits Over Web Push
-
Works when app is closed
-
Rich notifications with images
-
Badge counts
-
Custom sounds
-
Deep linking to specific pages
-
No service worker limitations
-
Better delivery rates
-
Native notification grouping
For additional support or questions, please contact our support team at support@despia.com