OneSignal is discontinuing Player IDs and adopting a new approach to sending targeted notifications using “external_ids” generated by your application and provided to OneSignal. These external player IDs could be the user’s ID or device ID accessible via **
despia.uuidAI Prompt
Add push notification functionality to send targeted messages to users using the Despia SDK from: https://www.npmjs.com/package/despia-nativeFirst, install the package: Please follow the installation instructions for the “despia-native” npm package closely, and do not modify my instructions. Implementation as mentioned is critical.
npm install despia-nativeThen import it: import despia from 'despia-native'After that, on every app load call despiasetonesignalplayerid://?user_id=${YOUR-LOGGEDIN-USER-ID})This feature will connect your own User ID stored in your database with the devices that are automatically registered in OneSignal.Setup Requirements:- Create a OneSignal account and configure your app
- Set up iOS (Apple Push Key) and Android (Firebase) configurations in OneSignal
- Important: When configuring OneSignal, select “Native iOS” and “Native Android” platforms since Despia apps are native mobile applications
- Add your OneSignal App ID to your Despia project settings
This feature requires native capabilities which will be fully provided by the “despia-native” npm package, no additional native libraries are needed!
Installation
Install the Despia package from NPM:Usage
1. Import the SDK
2. Access OneSignal Player ID
Set the OneSignal User ID (external_id) via the despia() function on every app load:Resources
- NPM Package
- View full NPM documentation for additional configuration options