Firebase messaging/mismatched-credential

The issue was with my google-services.json. My app uses two projects and was defaulting to the first project. Adding the second project json file ended up fixing this since it can now send the tokens to the proper project.


I faced the same problem. It took me two days to figure out that I need to enable the Firebase Cloud Messaging API through google cloud platform. Without enabling it, it also yields the error "mismatched-credential". I really wish that the error message could be more specific.


This error message can be found in the documentation for FCM.

It means that you've initialized the Admin SDK with a credential for a project that is not the same as the device registration token.

To put it another way: for security reasons, you can't simply send messages to any device token that you come up with. You can only send messages to device tokens via apps in the same project.