OneSignal is moving away from Player IDs toward
external_id, your own user ID from your database. Despia supports this. Pass your logged-in user’s ID via setonesignalplayerid:// and use include_external_user_ids when sending from your backend.Installation
- Bundle
- CDN
How it works
Despia registers the device with OneSignal automatically when the app launches. You link that device to your user by callingsetonesignalplayerid:// with your user’s ID on every authenticated app load. OneSignal stores the mapping. When you want to send a notification, your backend calls OneSignal’s REST API with include_external_user_ids targeting that user ID.
Setup Guide
OneSignal dashboard setup, Apple Push Key, Firebase config, and full API reference
Offline Push
Send local notifications without a server using sendlocalpushmsg://
OneSignal dashboard setup
Before callingsetonesignalplayerid://, configure OneSignal with your iOS and Android credentials.
Create a OneSignal account
Go to onesignal.com and create an app. When selecting platforms, choose Native iOS and Native Android, Despia apps are native applications, not web apps.
Configure iOS (Apple Push Key)
In OneSignal, go to Settings > Push & In-App > Apple iOS. Upload your
.p8 Auth Key from Apple Developer Console under Certificates, Identifiers & Profiles > Keys. You will need your Key ID and Team ID.Configure Android (Firebase)
In OneSignal, go to Settings > Push & In-App > Google Android. Enter your Firebase Server Key and Sender ID from your Firebase project settings under Cloud Messaging.
Resources
NPM Package
despia-native
OneSignal Dashboard
Configure your push notification app
REST API Reference
OneSignal Create Notification API