As of today, 2nd of July 2021. FCM libraries have some bugs due to which it fails to get tokens sometimes in Chrome browsers current version.
Errors that occurs :
- Uncaught (in promise) FirebaseError: Messaging: A problem occured while subscribing the user to FCM: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project. (messaging/token-subscribe-failed)
- “Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
How to integrate Firebase Push Notifications for Websites: https://www.kolkataonweb.com/code-bank/miscellaneous/website-push-notification-with-google-firebase/