GoogleChrome / GoogleChrome/samples

important question subscription keys

Open
#663 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.9k
Forks
2.4k
Avg merge
24m
Merged PRs (30d)
2

Description

**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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.