When you hit an issue with web push, it can be difficult to debug the issue or find help. This doc outlines some of the common issues and what you should do if you've found a bug in Chrome or Firefox.
Before we dive into debugging push, you may be hitting issues with debugging service workers themselves, the file not updating, failing to register or generally just unusual behavior. There is an awesome document on debugging service workers that I strongly recommend checking out if you are new to service worker development.
There are two distinct stages to check off when developing and testing web push, each with its own set of common issues / problems:
- Sending a Message: Make sure that sending messages is successful.
You should be getting a 201 HTTP code. If you aren't :
- Check for Authorization Errors: If you receive an authorization error message see the Authorization Issues section.
- Other API Errors: If you receive a non-201 status code response, see the HTTP Status Codes section for guidance on the cause of the issue.
- Receiving a Message: If you're able to send a message successfully,
but the message is not received on the browser:
- Check for Encryption Issues: See the Payload Encryption Issue Section.
- Check for Connection Issues: If the problem is on Chrome, it may be a connection. See Connection Issues section for more info.
If you aren't able to send and receive a