问题
I am implementing push notifications from my server to the users who are subscribed to my server.
Right now sending the push notifications to Firefox users works like a charm. However, on Chrome I get an Unauthorized Registration error. I am using Django as a backend.
In this image are the relevant parts of the error and my code (email edited), aswell as the subscription. If any more information is needed please let me know.
Does anyone know why I can't send push notifications on Chrome?
And I am using this library.
回答1:
In the murky depths of Google and Github I have found the answer. If you install pywebpush it installs v1.2.2 of py-vapid, which had a bug in it. Overwriting this package with
pip install py-vapid --upgrade
installs the patched version 1.2.3 (released only 5 days ago as of this post), fixes the Unauthorized bug I was having.
回答2:
I've just pushed pywebpush 1.0.2 which includes py-vapid 1.2.3. Sorry for the delay, but it was unavoidable.
Please don't be afraid to file issues against the package. I do try to respond fairly quickly and it helps out everyone.
来源:https://stackoverflow.com/questions/44121081/chrome-web-notification-push-unauthorized-registration-exception