- 06 Nov 2024
- 1 Minute à lire
- SombreLumière
Migration from 4.18.x and Previous Versions
- Mis à jour le 06 Nov 2024
- 1 Minute à lire
- SombreLumière
In April 2018, Google deprecated Google Cloud Messaging (GCM). The GCM server and corresponding client APIs are deprecated and were removed in April 2019. This requires a migration of GCM apps to Firebase Cloud Messaging (FCM).
Before you begin
Before you start the migration, note:
GCM and FCM SDKs cannot co-exist within the same mobile application.
GCM tokens retrieved via GoogleCloudMessaging.register() or InstanceID.getToken() continue to work in FCM without any modification or renewal.
Currently, the Notification SDK uses the FCM URLs to send and receive notifications on Android. Those modifications only affect the Android side on both the client- and the server.
FCM can manage both GCM and FCM tokens; therefore, the server-side must be migrated before the client side.
Android server-side
There are two ways to migrate the server-side:
Via the project number equivalent or legacy key. This is the easiest way to complete the migration, and requires less effort for the migration. To migrate the server-side, update the server .jar dependencies. The new library connects automatically to the FCM back end to send the notification.
Via OAuth and the Firebase account JSON file. This is the quickest way to connect to the Firebase back end, and the cleanest solution if you do not have an existing code base.
For more detailed information on those steps, see Integrate the Notification SDK Client and Enable Push Notification in a Google project.
Android client-side
Since GCM and FCM SDKs cannot co-exist within the same mobile application, the migration requires code modifications.