Ad

Send Mobile App Push Notification With Onesignal REST API To Devicetokens Stored In DB

- 1 answer

I am developing REST API's in Node.js, which are consumed by mobile app. Now I want to send push notifications to devices of which, device tokens are stored in my database.

It can be both on IOS and Andrioid and notification can be for single device or multiple device.I need to send it with Onesignal Rest API and I think it can be achieved with "create notification API" as mentioned in there documentation here https://documentation.onesignal.com/reference.

=> Is that any other step required in sending it with Onesignal and device tokens stored in DB?

=> And where I need to add that device tokens from my database in that request?

Ad

Answer

Thanks for your question. After integrating our SDK, you shouldn't need to manage the tokens yourself. The SDK will generate a "Player ID" for each device. Then, you can send notifications based on this identifier or can even associate this ID with your own "external_id". Take a look at our documentation on how to manage users in OneSignal. Also, I'd recommend checking out our blog post regarding integration with your own DMP. You'll also get a better idea of how

Ad
source: stackoverflow.com
Ad