samples icon indicating copy to clipboard operation
samples copied to clipboard

important question subscription keys

Open IDONTSUDO opened this issue 5 years ago • 2 comments

I have such code on the server. It logs user keys for subscribing service wokers to the server.

exports.PushUsers = (req,res) =>{ const subscription = req.body

console.log("ITSKEY",subscription.keys.p256dh )

On the external interface there is code that is responsible for subscribing to the push notification server.

function sendSubscription(subscription) { return fetch(${process.env.REACT_APP_API_URL}/push/user/, { method: 'POST', body: JSON.stringify(subscription), headers: { 'Content-Type': 'application/json' } }) }

Can I find out what subscriptions user has subscription.keys?

P.S. I tried to log the subscription object. But there are no keys in it. Apparently, the mechanics of their formation are encapsulated.

IDONTSUDO avatar Nov 15 '19 09:11 IDONTSUDO

Ы

kostia7alania avatar Nov 15 '19 10:11 kostia7alania

That is an interesting question!

letsget avatar Nov 15 '19 12:11 letsget