Closed alsiPanda closed 3 years ago
Sounds like an issue with your webpush token, see if you can decode it yourself using pyJWT
Sounds like an issue with your webpush token, see if you can decode it yourself using pyJWT
Thanks @dashdanw, a couple of doubts more here -
Is the webpush token the auth
value from subscription.keys or p256dh
or the registration_id ?
Also in pyjwt, should I use rs256 or hs256 ?
Or should I use the py_vapid.jwt and decode auth/p256dh with either auth or the private_key ?
@dashdanw I am very new to push notifications, so can't figure out which one to decode, using which algorithm. Please help.
Turns out the problem was in settings.py. WP_PRIVATE_KEY should be literally the key string. I had instead used path to key file.
I have a django rest framework as my api backend(google compute engine) and flutter web in the front(localhost). My backend has no SSL or domain name. Whenever I try to send notification using
device.send_message()
I get the errorValueError: Could not deserialize key data
. I have verified everything before this step, including the WebPushDevice . Can't figure out why I am getting this error. Does this have anything to do with not having SSL ?