Hello all,
I'm currently managing a service that has sent notifications to devices in our Android project using a POST request to the legacy HTTP endpoint:
https://fcm.googleapis.com/fcm/sendWe only need our API Key in the header, and DeviceToken in the Token field of the message, in order for the notification to reach a device which has our app installed.
However, now we are trying to migrate to the firebase-admin-go SDK. We have been successful with setting up an instance of the Firebase App and Messaging Client in our code. But when we try to call the Client's Send() method to send the notification payload to a device, we get a HTTP 403 error with the following description: "Reason: Sender ID does not match Registration Token; code: mismatched-credential.
The ProjectID that we give our FirebaseConfig in order to initialize the app matches the Firebase documentation; it is the ProjectID of our firebase-adminsdk Service Account. The number in the ProjectID matches the SenderID for our Firebase App. And that SenderID matches the google-app-id of our Android project. Our Android project does not have a google-services.json file, which I've seen to check in some troubleshooting answers.
It is important to note that our Android app still uses GCM, instead of FCM, to generate Registration Tokens for our client devices. Furthermore, our Android app does not even have Firebase as a dependency. We are hoping that since we didn't need to have Firebase on our Android app before when we were sending POST requests straight to FCM, that we won't need it now. If this is not true, please let us know!
Since there is no mismatch between the Project, Sender, or App IDs, the Firebase documentation has not been sufficient for us to solve this issue. We are wondering if anyone knows if there are certain steps that we have to take, such as extra details that we need to include in our message payload, or additional modifications or upgrades that we have to make to our Android App, in order to solve this error.