vickstricks
vickstricks

Reputation: 71

How to send one signal notification from asp.net webapi to ionic app

I'm developing android and iOS application using cordova ionic and I include one signal notification as a feature in my app.

I register onesignal and test to push notification. It's work well.

Now I want to send onesignal notification from asp.net web api to perticular user. I have tried this url but I failed. Also i am unable to get device token in my app.

Thank you.

Upvotes: 7

Views: 11027

Answers (1)

jkasten
jkasten

Reputation: 3948

You need to call window.plugins.OneSignal.getIds and store ids.userId from the callback.

You can then make a POST call to the https://onesignal.com/api/v1/notifications endpoint from your ASP.NET code setting the include_player_ids to the userId retrieved from your app.

There is an ASP.NET example towards the bottom of the endpoint documentation page listed below. https://documentation.onesignal.com/reference#create-notification

Upvotes: 9

Related Questions