Balaji.V
Balaji.V

Reputation: 31

How to push web notification for specified user or player in One signal

I need to send web push notification for single user (may be player in case of one signal) using create notification API? in one signal. I have gone through the documentation, it is stating that we can send push notifications to segment or group but not to single user.

Upvotes: 3

Views: 1743

Answers (1)

Patricio Vargas
Patricio Vargas

Reputation: 5522

You can get the userId by doing this: OneSignal.getUserId()

To learn more about the getUserId(): https://documentation.onesignal.com/docs/web-push-sdk#user-ids

To learn more about sending push notifications to specific users, please refer to: https://documentation.onesignal.com/reference/create-notification#send-to-specific-devices

Upvotes: 0

Related Questions