Follow below steps for setting up a fresh firebase project for push notifications.
- Go to https://console.firebase.google.com
- Click on Add Project
- Enter the Project Name and click on Continue
- Disable Google analytics and click on Create Project
- Wait for a bit till it creates your project and click on Continue
- Click on Android icon to add firebase to your Android App
- Give the package name, you can get this value in your first email from androapp
- Give your app a nickname if you wish
- Leave the signing certificate SHA-1 field empty and click on Register App
- Click on Download google-services.json file
- open that file, it will look like this
- Copy the whole file and paste it in the text box in Account Settings tab
- Note: please update the plugin if you don’t see the textbox.
- Come back to firebase page and Click on Next and Finish in next screens.
- No need to press sync now and click on Next
- Click on Continue to Console button
- You should be able to see your app with the nickname you entered on the top
- Click on that and click on settings icon
- Go to Service Accounts tab and click on Generate new private key button
- Download this file to your server and update the file path in textbox in Firebase Api Settings section on AndroApp->Account Settings tab on your wordpress admin dashboard.
- you might need to enable Firebase Cloud Messaging api from https://console.developers.google.com/apis/api/fcm.googleapis.com/overview?project={project_number}
- replace {project_number} from Google Api you extracted earlier, i.e. 370901340170 from 1:370901340170:android:ce70542cdae49cac
- Create a new APK and test the push notifications, go here for troubleshooting push notification.
Here are the old instructions to follow for v0 api (just in case you need) to be followed after step 17).
- Go to cloud messaging tab and copy the Server key to Google Api Key textbox in AndroApp Account Settings tab.(this is different from what you see in google-services.json, you have to enter the server key from this screen to google api key textbox in AndroApp Settings page and not from google-services.json file)
- You are done !!
- Create a new APK and test the push notifications, go here for troubleshooting push notification.
Legacy Key Is Also Server Key Right?
yes..