Reputation: 874
I have a use case that I only have to send a notification
to a specific user when I updated the user data from a desktop application. So that's why I need to get player_id
generated by OneSignal
? But their documentation does not show everything.
Upvotes: 1
Views: 1200
Reputation: 1687
You can use addsubscriptionobserver
Ref: addSubscriptionObserver
this.oneSignal.addSubscriptionObserver().subscribe((state) => {
if (!state.from.subscribed && state.to.subscribed) {
console.log("Subscribed for OneSignal push notifications! :: ID "+state.to.userId);
}
});
Upvotes: 4