Recently I changed the “google-services.json” file in my app. The previous developer use different “google-services.json” file, so I changed it for getting firebase analytics. I don’t have the access the previous Firebase project, so I cannot use firebase analytics. After changing the “google-services.json” file, I am not getting push notification in my app. Do I have to change anything from backend? Thanks in advance
Asked
Active
Viewed 1,840 times
2
-
Any other error message? – blessthefry Dec 21 '20 at 17:14
-
No error message, but onMessageReceived isn't getting called. I talked with backend developer, they are saying they are identifying my device. But they didn't update server key. – Mdohammad Sajib Al Seraj Dec 21 '20 at 18:47
2 Answers
3
Your Backend is still sending the push messages to the previous FireBase project. So when you change the FireBase project and have a new google-services.json
configuration you need to update the ServerKey
on your backend as well.
How to get the Server Key on Firebase
- Go to https://console.firebase.google.com/
- Select the project
- Click on the Project Overview → Project Settings
- Select "Cloud Messaging" tab.
- Under "Project credentials" you should be able to see the Server key or generate a new one.

ChristianB
- 2,452
- 2
- 10
- 22
-
I talked with backend developer, they are saying they are identifying my device without updating server key. But I am not getting push notification. Any idea? – Mdohammad Sajib Al Seraj Dec 21 '20 at 18:49
-
Here are some more documentation: https://stackoverflow.com/questions/37337512/where-can-i-find-the-api-key-for-firebase-cloud-messaging/ and https://blog.techmagic.co/firebase-cloud-messaging-for-push-notifications/ – ChristianB Dec 21 '20 at 19:12
-
0
Just changing “google-service.json” file won't work
After changing the “google-service.json”, run flutter clean
will fix the issue

Mohammed Farhan M M
- 11
- 1
- 2