If you already have an existing Firebase project into which you would like to migrate a GCM app and its users, there are special steps you must perform. These special steps are required because the existing Firebase project will not be able to send messages to tokens belonging to a completely separate GCM project. Until all client app instances upgrade to your Firebase app, you'll need to create a mapping between old GCM tokens and the Firebase project.
- Update your app's client-side code and server endpoints to use FCM as
described in steps 2-5 of the normal flow with one important exception: use the
google-services.jsonfile from your existing Firebase project.
- Use the
getTokenmethod with no parameters and store your new tokens, making sure to associate them with your existing Firebase project and server key (that is, store the Firebase project ID alongside the token).
- If you send to topics, unsubscribe old tokens from all of your old GCM project's topics and re-subscribe to equivalent topics for the existing Firebase project.
- Continue to use your old server key to reach your existing GCM instances until those instances successfully upgrade their client to the FCM version.