Re: Migration from GCM to FCM without changing Android native code needed?

410 views
Skip to first unread message

Diego Giorgini

unread,
Oct 30, 2018, 2:15:39 PM10/30/18
to andro...@googlegroups.com
https://developers.google.com/cloud-messaging/faq 

How long do I have to migrate to FCM?

We will turn off most GCM services in April 2019, so you should plan to have most of your services migrated by then.

Note that client SDKs and GCM tokens will continue to work indefinitely. However, you won't be able to target the latest version of Google Play Services in your Android app unless you migrate to FCM.


On Tue, Oct 30, 2018 at 5:42 AM o0omycomputero0o <anhh...@gmail.com> wrote:

Google Developer page has announced the message like the following:

As of April 10, 2018, Google has deprecated GCM. The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. Migrate GCM apps to Firebase Cloud Messaging (FCM), which inherits the reliable and scalable GCM infrastructure, plus many new features. See the migration guide to learn more.

And from firebase.googleblog.com:

If you have projects that are still using the GCM APIs, you will need to update your client and server code to use FCM before April 11, 2019. But rest assured, your existing GCM tokens will continue to work with FCM so you won't lose the ability to send messages to your existing users.


I've confused with these messages. Does this mean?

  1. 1/ Change the server's endpoint to FCM's ones: fcm.googleapis.com/fcm/ and fcm-xmpp.googleapis.com (this point is OK to change)
  2. 2/ MUST we change our app to use FCM library rather than GCM(gcm.jar) library? Or can we just keep old GCM(gcm.jar) and JUST ONLY change server?

And a question about the internal working of Google push notification:

  1. 1/ How can my previous user with GCM(gcm.jar) code continue to receive notification after GCM shutdown? Does this mean GCM library is just an intermediate (.i.e. Push notification redirector) to receive the token and notification message? Is there mechanism from Google to redirect to correct notification URL like the following picture?

--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/c3118325-8416-452c-8a5a-9cb4c7755631%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

o0omycomputero0o

unread,
Oct 30, 2018, 8:43:05 PM10/30/18
to android-gcm
Thank you. I've some points need to be clarified:
 
Note that client SDKs and GCM tokens will continue to work indefinitely

Does client SDKs here mean old GCM library I've used?

However, you won't be able to target the latest version of Google Play Services in your Android app unless you migrate to FCM.
 
I don't know the meaning of Target the latest version of Google Play Service can you giving more detail. Also combined with `Meet Google Play's target API level requirement`  (https://developer.android.com/distribute/best-practices/develop/target-sdk) does this mean I cannot release a new version of our app with our current GCM implementation? And does GCM still work after updating target to Android 8.0 (API level 26) or even updating to Android 9.0(API level 28) ?

Diego Giorgini

unread,
Oct 30, 2018, 9:01:37 PM10/30/18
to andro...@googlegroups.com
On Tue, Oct 30, 2018 at 5:43 PM o0omycomputero0o <anhh...@gmail.com> wrote:
Thank you. I've some points need to be clarified:
 
Note that client SDKs and GCM tokens will continue to work indefinitely

Does client SDKs here mean old GCM library I've used?

any GCM library.

Please note that specific Android OS versions might require different GCM library.
Example:
Android versions >= 26 requires GCM or FCM version >= 11

(this happened because of the significant changes in Background Restrictions introduced in Android O)
 

However, you won't be able to target the latest version of Google Play Services in your Android app unless you migrate to FCM.
 
I don't know the meaning of Target the latest version of Google Play Service can you giving more detail. Also combined with `Meet Google Play's target API level requirement`  (https://developer.android.com/distribute/best-practices/develop/target-sdk) does this mean I cannot release a new version of our app with our current GCM implementation? And does GCM still work after updating target to Android 8.0 (API level 26) or even updating to Android 9.0(API level 28) ?

Assuming your build file has something like:

dependencies {
    compile "com.google.android.gms:play-services-gcm:6.0.0"
    compile "com.google.android.gms:play-services-OTHER-LIBRARY:6.0.0"
}
You will not be able to update that to a more recent version of Google Play services, 
since we will stop releasing new versions of GCM Client SDK.

o0omycomputero0o

unread,
Oct 30, 2018, 10:08:48 PM10/30/18
to android-gcm
Thank for the quick response
any GCM library.
Currently, I use gcm.jar (v1.0.2) which is pretty old; so does it still works?

(this happened because of the significant changes in Background Restrictions introduced in Android O)
Also, I've set targetSdk to 28; and I can still receive notification on my Android 8.1 device now. So what specific functions of the push notification are breaking on  Android O?

I want to ask more about the problem I've confused about Client SDK (GCM Client SDK and even FCM SDK):
Do they connect to FCM or GCM? Or do they delegate the creating connection to task to push notification server(GCM or even FCM) to Google Play Service? I think that the latter is true (Client SDK delegate the creating connection to task to push notification server); so we still can use any GCM library but still can get a new token on new devices, doesn't it?

Thanks.

Diego Giorgini

unread,
Oct 31, 2018, 4:19:01 PM10/31/18
to andro...@googlegroups.com
On Tue, Oct 30, 2018 at 7:08 PM o0omycomputero0o <anhh...@gmail.com> wrote:
Thank for the quick response
any GCM library.
Currently, I use gcm.jar (v1.0.2) which is pretty old; so does it still works?

gcm.jar still works, on the Android versions that existed when it was released and supported.
New Android versions can introduce OS changes that can break libraries.
When that happens we update the libraries that are being supported, but we don't update libraries that have completed the deprecation period.

gcm.jar was deprecated and removed from distribution long ago, so I cannot say if it still works with newly released version of Android.

(this happened because of the significant changes in Background Restrictions introduced in Android O)
Also, I've set targetSdk to 28; and I can still receive notification on my Android 8.1 device now. So what specific functions of the push notification are breaking on  Android O?

GCM versions < 11  uses to call the startService() API, which was changed by Android O to throw a IllegalStateException if the app executes the call while NOT in foreground.
 
I want to ask more about the problem I've confused about Client SDK (GCM Client SDK and even FCM SDK):
Do they connect to FCM or GCM? Or do they delegate the creating connection to task to push notification server(GCM or even FCM) to Google Play Service? I think that the latter is true (Client SDK delegate the creating connection to task to push notification server); so we still can use any GCM library but still can get a new token on new devices, doesn't it?

Thanks.

Both GCM sdk and FCM sdk use Google Play services to create tokens and receive messages.
Google Play services is not being deprecated.
GCM sdk is being deprecated in favor of the FCM sdk.
In this context deprecated means:
- already released versions of the GCM sdk will keep working
- GCM sdk will not receive updates, bugfixes or support
- if future versions of Android will introduce breaking changes, the GCM sdk will NOT receive the necessary updates and therefore will not work on the new devices.

On the Server side, the GCM endpoint is being deprecated in favor of the FCM endpoint.
- the FCM endpoint supports GCM token
- we plan to disable the GCM endpoint in the future

 
Reply all
Reply to author
Forward
0 new messages