Erwin Idamsyach Putra
Erwin Idamsyach Putra

Reputation: 23

How to send web notification using OneSignal js

I'm new in OneSignal, and after cofigure my OneSignal, I want to send notification via my script using OneSignal API, can anyone help me? I doesn't have any idea for this, I have read the API referrence but I don't know how to start this.

Upvotes: 1

Views: 4212

Answers (1)

Gdeglin
Gdeglin

Reputation: 12618

Notifications can be sent through the OneSignal REST API, as documented here: https://documentation.onesignal.com/reference#create-notification

In general notifications should be sent from your server code, and not your client code. This is because sending a notification usually requires a private API key for security, and this key must be kept secret. You can find examples of how to do this in various languages near the bottom of the page linked above.

Upvotes: 1

Related Questions