How to Setup Firebase Cloud Messaging

Follow below steps for setting up a fresh firebase project for push notifications.

  1. Go to https://console.firebase.google.com
  2. Click on Add Project
  3. Enter the Project Name and click on Continue
  4. Disable Google analytics and click on Create Project
  5. Wait for a bit till it creates your project and click on Continue
  6. Click on Android icon to add firebase to your Android App
  7. Give the package name, you can get this value in your first email from androapp
  8. Give your app a nickname if you wish
  9. Leave the signing certificate SHA-1 field empty and click on Register App
  10. Click on Download google-services.json file
  11. open that file, it will look like thisscreen-shot-2016-10-02-at-1-59-04-pm
  12. 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
  13. Click on Next and Finish in next screens.
  14. No need to press sync now and click on Next
  15. Click on Continue to Console button
  16. You should be able to see your app with the nickname you entered on the top
  17. Click on that and click on settings icon
  18. 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)
  19. You are done !!
  20. Create a new APK and test the push notifications, go here for troubleshooting push notification.

 

Related Post

2 thoughts on “How to Setup Firebase Cloud Messaging”

Leave a Reply

Your email address will not be published. Required fields are marked *