Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCMRegistrar vs GoogleCloudMessaging which to use?

Another one of my stupid questions probably.

I am confused on which to use GCMRegistrar or GoogleCloudMessaging, i know that GCMRegistrar is deprecated and i want to use GoogleCloudMessaging API but the problem is i can't find the jar files for it. so if you could help me by giving me jar file for the new GoogleCloudMessaging API it would help me a lot.

Thanks in advance!!!

like image 815
Vardhan D G Avatar asked Jul 04 '13 10:07

Vardhan D G


People also ask

What is difference between FCM and GCM?

FCM is the new version of GCM under the Firebase brand. It inherits GCM's core infrastructure to make sure we continue to deliver messages reliably on Android, iOS and Chrome. Save this answer.

What is Google Cloud Messaging used for?

Firebase Cloud Messaging (FCM) provides a reliable and battery-efficient connection between your server and devices that allows you to deliver and receive messages and notifications on iOS, Android, and the web at no cost.

How do I use cloud messaging provider?

Implementation pathSet up Firebase and FCM on your app according to the setup instructions for your platform. Add message handling, topic subscription logic, or other optional features to your client app. During the development, you can easily send test messages from the Notifications composer.


2 Answers

That's because GCM before was a library, now it's part of the Google Play Services. So to use it you will need to follow this tutorial and download and include the Google Play services on your project using this page

You are welcome :)

like image 138
cvacas Avatar answered Oct 04 '22 21:10

cvacas


Yes gcm.jar is deprecated. But I didn't find good explanation "why"! GCMRegistrar was good helper class. When you look at its sources you'll find that it's almost the same as example code of (now preferred) GoogleCloudMessaging API. So Google wants everyone to write (or copy) again and again the same code into all projects using GCM? Or shall every developer create his/her own helper class, a GCMRegistrar alike?

On the other hand when I use Google Play Services library, I use a library with a lot of ballast I don't need, I need just GCM, I'm not interested in other services.

Why don't they create a library for each service? GCM, Maps, Ads, Wallet, ... so every developer can include only what he needs.

Google's approach is far from optimization. I want to create as small and fast apps as possible. Google obviously doesn't. :-(

like image 43
Martin Edlman Avatar answered Oct 04 '22 21:10

Martin Edlman