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 mobilesdk_app_id value from the file to Google App id textbox in Account Settings Tab. it will look like this: 1:370901340170:android:ce70542cdae49cac
- 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 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..