How to get Firebase Service Account JSON for PWA Web Push?

Starting from, June 20, 2024 the legacy Firebase Cloud Messaging (FCM) APIs will be discontinued. So our previous PWA push send method using legacy firebase server key will stop working on June-20, 2024. So we’ve updated our PWA Push Module, now we’re using the latest FCM HTTP V1 API for sending the PWA push. The FCM HTTP V1 API requires generating an access token using a Firebase service account JSON. In this tutorial, we explain how to obtain this Firebase service account JSON.

Visit https://firebase.google.com and click on “Go to console” shown at the top right corner.

All your Firebase projects will be displayed. Click on the Firebase project you are using for PWA Push. Use the same project that you are using in the PWA Push Firebase config.

Hint: You can find your Firebase config details in Siberian Backoffice > Manage > Modules > PWA Push > Firebase Config Details Section. Here you can find your project ID to identify your project if you have many Firebase projects.

Click on the “Settings icon” and choose “Project settings“.

Click on the “Service Accounts” tab.

Click on the “Generate new private key” button.

Click on the “Generate key” button.

Now the JSON file will download to your computer. Open it with any text editor like Notepad, Sublime Text, etc., to view its contents.

Keep this JSON file stored on your computer for future use.

You need to copy and paste this JSON code into Siberian Backoffice > Manage > Modules > PWA Push > Firebase Service Account JSON Section.

Just save it, and then it will display a screen like the one shown below.

Click on the “Test Token Generation” button to generate a test token. It will be displayed one time only (on refresh of this page, it won’t be displayed again). The token text will start with “ya29.c.”

If test token generation isn’t working or the token shows null, please inform us. We’ll help you resolve the issue.

For push send method, select HTTP2 Batch or HTTP2 Multiplexing.

Your server should meet the Siberian server requirements, mainly PHP cURL with HTTP/2 support and OpenSSL. We use OpenSSL for access token generation and cURL HTTP/2 for push sending.

We provide four different methods for push sending because some users have very low server specifications/resources while others have excellent server specs. For now, select either “HTTP2 Batch” or “HTTP2 Multiplexing.” The end results of all methods are the same; they just use different methods to send a push to the Firebase server.