Skip to content Skip to sidebar Skip to footer

Difference Between Deprecated Gcm And New Gcm Which Uses Google Play Service

Is deprecated gcm reliable to use now and when probably will be down?I mean gcm which has no depency on google play service(gcm.jar-GCMRegistar version). I tested latest gcm versio

Solution 1:

When using the new gcm library you should include the individual dependency not the entire play-services library.

use:

compile'com.google.android.gms:play-services-gcm:8.4.0'

instead of:

compile'com.google.android.gms:play-services:8.4.0'

Same for other Play Services libraries eg: play-services-drive

Solution 2:

Although the old GCMRegistrar API will still be supported, you should definitely change to the new GCM API. The new InstanceId API has many advantages and improvements comparing to the old one and works very well (I tested it in production for months).

https://developers.google.com/instance-id/#key_features

Instance ID, Identity, and Authorization

Instance ID (IID) allows you to retrieve a unique identifier for every app instance, providing a mechanism to authenticate and authorize actions, even if your app does not have user registration and accounts. For example, this allows you to uniquely determine which app instance is sending a request from by including the Instance ID token. We’ve also made it easy to handle edge cases to ensure that you’ll have valid Instance ID tokens.

And here is the very interesting part from the server side:

https://developers.google.com/instance-id/reference/server#get_information_about_app_instances

About the library size and as @Arthur pointed out you should just use what you need from the Play Services library. Here you have the list of individual libraries you can refer from gradle instead the whole bundle.

Post a Comment for "Difference Between Deprecated Gcm And New Gcm Which Uses Google Play Service"