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.
To get the API Key and the App ID from OneSignal, navigate to the OneSignal Dashboard and click on the app you created inside of OneSignal. Once you have selected the app you want to work with, click the Settings tab. On this page, click on Keys & IDs. Copy the OneSignal App ID and the REST API Key.
Ionic is easy to integrate with Firebase and Firebase Cloud Messaging, which allows you to enable push notifications quickly.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With