Closed andynewman10 closed 3 months ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi @andynewman10, thank you for reaching out. Firebase Cloud Messaging (FCM) registration token is a unique identifier assigned to each Firebase app instance on a device.
A Firebase project can’t send a message to another Firebase project because each has different configurations, including API keys, sender IDs, and authentication methods. On attempts to send messages to a registration token from another Firebase project, you will encounter SENDER_ID_MISMATCH (HTTP error code = 403)
that means the authenticated sender ID is different from the sender ID for the registration token.
To add, FCM supports multiple sender IDs on certain SDK (i.e. iOS). Multiple Sender IDs allow the developers to send notifications to a single app from multiple projects. To do this you need to generate a registration token for other Sender IDs using the retrieveFCMToken(forSenderID:) or -retrieveFCMTokenForSenderID:completion: methods on iOS. Please note that this would only work using the default FirebaseApp/FIRApp.
Currently, we don't have a similar method on Android. The [getToken()](https://firebase.google.com/docs/reference/android/com/google/firebase/messaging/FirebaseMessaging#getToken()) only retrieves the registration token for the project/sender ID configured, but there is an existing request to support this feature.
I'll be closing this issue now. Let me know if there's any misunderstanding and/or we need to re-open this for clarification. Thanks!
What feature would you like to see?
When developing an app, we usually use a Firebase project dedicated to development, different from the production project.
However, a developer, while using the development Firebase project, may accidentally send a message to a production FCM token. This might happen when retrieving the production database for analysis on a development computer, and inadvertently sending FCM messages.
What is supposed to happen in this case and is this behavior documented somewhere? Is this guaranteed to fail (hopefully yes), or do I have to explicitly store the project id bound to any FCM token to make sure I never get mixed up when sending an FCM message from the server?