Javascript Web Push: where can I get "auth" key? -
i'm stating using web push notification; don't know can find auth
key:
var pushsubscription = { endpoint: '< push subscription url >', keys: { p256dh: '< user public encryption key >', auth: '< ???? user auth secret ???? >' } };
i can endpoint
, p256dh
serviceworker>registeration.pushmanager.getsubscription()
not auth
key.
thanks
you can use getkey
method both p256dh
, auth
(see the specs or the example specs).
it's simpler call json.stringify
on pushsubscription
object returned getsubscription
promise.
Comments
Post a Comment