Migration from 4.18.x and Previous Versions
  • 06 Nov 2024
  • 1 Minute à lire
  • Sombre
    Lumière

Migration from 4.18.x and Previous Versions

  • Sombre
    Lumière

The content is currently unavailable in French. You are viewing the default English version.
Résumé de l’article

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.


Cet article vous a-t-il été utile ?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Ozzy, facilitant la découverte de connaissances grâce à l’intelligence conversationnelle