I have this Code in node Js :
var push = require('web-push');
let vapidKey = {
publicKey: 'BIHeRRehOFJrIOs6n-T-dyAHX4aZ2CjetOIXzUjFUBsKEjTuLc94GXkJpXjWMtSipSQUH-B-Qzv1MP-F-Wc8YcE',
privateKey: '18kZ2GUHe84MKRKbtYIg3uiiFeUtbWFxW96cmHvh1L8'
}
push.setVapidDetails('mailto:test@code.co.uk', vapidKey.publicKey, vapidKey.privateKey)
let sub = {"endpoint":"https://fcm.googleapis.com/fcm/send/fQ4t6OgnM6c:APA91bHFGXbUuTawigsgaBUR52tPEai5wd_LCQ3S_LI7XW1xMq1vj9Bb2prS4MPJcxI6PfU2r360A2KwiA1eNzw9GZXPRGoxXjR3WfuXMJsY84vr1tgpyBhtjL4Xc80piuBPca3bJ9bd","expirationTime":null,"keys":{"p256dh":"BMmw5Uh7Ba7XnWWCQdLosMOYjoQPxS26m3uqAiPCqmBn35jF0qRJRa0sXk5CU84IZGwr6Xw5jWwOHIM2Ie6bJ0U","auth":"gts2sn6zf3ID9K6Vd6DIpA"}}
push.sendNotification(sub, 'test message')
With this code we can set our public and private key by function (set Vapid details).
and we can send new notification to start serviceWorker again and show new Notification by function (sendNotification) After set Subscribe code in this function in Node.js
my question is : How can do that in ASP.net Web API ?? in which function should I Set public and private keys, also which function should use to make serviceWorker start again and show new Notification?
I searched a lot on the internet and couldn't find anyone to address this point in ASP.net Web API I found only Mvc
I hope your help with any information or any source code or Video