GCM without using Firebase - android

Is it OK to use GCM without involving Firebase?
As I saw from Google(https://developers.google.com/cloud-messaging/android/client) that, "New Cloud Messaging projects must create a Firebase project". Is it true?

TL;DR: Yes. You could still use the service without (technically) using Firebase.
Google Cloud Messaging is the old version for Firebase Cloud Messaging. During that time, it was only required to create a Google Developer Project in order to use the service.
GCM has since become part of Firebase and was rebranded as Firebase Cloud Messaging. Although the name adds in Firebase, FCM is still a service on it's own, where most of what it is right now, is still based from the old version (of course there are a lot of new stuff by now, but you get what I mean) -- in which case you can still use the service without using the other Firebase services.
Creating a Firebase Project doesn't mean you would have to use or it counts as using the other Firebase services. It's just the place where you would see most of the data related to your FCM service.
All users, even the old GCM users, are currently (strongly) encouraged to actually import their projects to Firebase Console.

Related

Do I need to migrate GCM to FCM on client side?

I have the old android app on Play Store which I am not going to update anymore because of making a new app.
Do I need to migrate GCM to FCM in my old android app?
Many sources say:
You have to change your client side... blabla... etc...
but GCM and FCM FAQ says:
GCM tokens will continue to work on client devices.
Existing installs of client-side apps receiving notifications will continue to work for the foreseeable future. You don't need to get new tokens for all users. The existing tokens from GCM will continue to work
But from mid-April:
You won't be able to compile code using the old client-side APIs on a newer SDK/Google Play Services anymore
You won't be able to call the GCM REST API to send messages anymore
New installations of your existing GCM-using app may not be able to get a token.
To compile against the new SDK/Google Play Services, you will need to make changes to your client app to migrate to Firebase Cloud Messaging from GCM. This involves changes to the build.gradle, to AndroidManifest.xml and to your code, as described in Migrate a GCM Client App for Android to Firebase Cloud Messaging.
You need to update your client code and migrate to FCM. Because it is officially announced to do migration and it is very likely that from a point, for example by one of the android updates, they stop supporting old api callbacks and if so you will lose part of your users.
So my advice is to do the migration as it has been long enough so far that they had supported GCM along with supporting FCM and they can't and won't do it forever.

Link existing Firebase and Google Cloud projects

I am trying to migrate my Android app from GCM to FCM.
I use Google Cloud project for GCM and Firebase project for some Firebase features (Analytics, etc.) now.
Docs say that I need to import Google Cloud project to Firebase, but I already have Firebase project for my app.
As I understand, it is needed to provide GCM and FCM tokens compatibility.
So, how to link existing Firebase and Google Cloud projects?
If it is impossible, is it possible to send messages to old tokens using new FCM endpoints and which credentials (Google Cloud or Firebase) should be used for it?
All Firebase project are also Google Cloud projects. You don't "link" them together - they are the same. They have exactly the same configurations and service accounts.
When you imported Firebase into your existing Google Cloud project, what you did was add Firebase APIs to it. Now you should be able to use Firebase services with your same project. It sounds like you should just start using Firebase in your project as you would normally.
The GCM and FCM backends are essentially identical, except for the endpoint that you use to send messages. So, try sending messages to the new endpoint.

Can I use both GCM and FCM in my app?

I have an android project in which GCM is implemented. Back-end (server) is already coded suitably with GCM.
Now is it possible to add firebase (FCM) in my project and work in parallel with GCM? I cant migrate to FCM because it is impossible to change my back-end code as it is a big project and too much code is there. Has anyone done something like this?
Please help. Thanks in advance.
Though my particular case might be a bit specific, because the project I am involved in has a very specific backend, it seems to me FCM interoperates well with GCM, i.e you can have both in your app, GCM and FCM broadcast receivers / receiver services, and they will both work as well with no conflicts.
This has a huge advantage because you don't have to decide with migration at once, you can do this more gradually.
Well done, Google!
No, you can not use both FCM and GCM at same time. GCM is the old version and that it is strongly recommended to use FCM.
Why is Google Cloud Messaging (GCM) part of Firebase? How does it relate to Firebase Cloud Messaging (FCM)?
Google is investing in Firebase, making it our unified mobile
platform.
Over the last few years, we have expanded GCM to send messages to
multiple platforms beyond Android: iOS and Chrome. Firebase is known
for being cross platform, so FCM now makes a natural fit in the
Firebase suite of features designed for Android, iOS, and mobile web.
Another core value of Firebase is cross-feature integration. We are
adding the ability for other Firebase features to easily send messages
via FCM. For example, you can use Firebase Notifications to send
reengagement messages to your users.
We think that GCM will be even more useful to developers as an
integrated part of Firebase. You can still get the same great product,
now under a new name: "Firebase Cloud Messaging," or FCM for short.
Is GCM going to be deprecated?
We will continue to support the current version of GCM Android and iOS
SDKs because we know a lot of developers are using GCM SDKs today to
handle notifications, and client app upgrade takes time.
But all new client-side features will be added to FCM SDKs only moving
forward. You are strongly encouraged to upgrade to FCM SDKs.
You can get more details here
As per FAQ you don't need additional server configuration when you're migrating your client app from GCM to FCM, so just use FCM in your android app.
Here's the docs on how to migrate your app
I find the problem to use both GCM and FCM together. You will get to different deviceToken and one of these token get NotRegistered error.
For my FCM token always get NotRegistered error but the app is active and not uninstalled and my GCM token is valid and gets a push notification.

Is Google GCM still available?

I'm trying to create a simple android push notification app using Phonegap build and GCM.. I currently can get the android's device token using a phonegap plugin and store it in my database without any issue.
I just need to know if I can still use GCM (Google cloud messaging) OR I need to start using FCM (Firebase Cloud Messaging)?
Any tutorial I found on Google is about GCM and they all say to enable the 'Auth & API' under the google cloud messaging section in the google console. but when i go to GCM in my Google console, I don't see anything like that and everything seems to be about FCM which is frustrating when there are no information about how to use it with Phonegap build!
Is Google GCM still available or the new app 'Have' to start using FCM from now on?
I mean Google console is confusing enough without them keep changing everything every month or so!!
Could someone please advise on this issue?
Cloud Messaging (GCM) is now part of Firebase, see also this link.
Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features!
If you are integrating messaging in a new app, start with FCM. GCM users are strongly recommended to upgrade to FCM, in order to benefit from new FCM features today and in the future.
Is GCM going to be deprecated?
We will continue to support the current version of GCM Android and iOS SDKs because we know a lot of developers are using GCM SDKs today to handle notifications, and client app upgrade takes time.
But all new client-side features will be added to FCM SDKs only moving forward. You are strongly encouraged to upgrade to FCM SDKs.
In short, stop using Google developer console in order to use GCM, use this:
https://console.firebase.google.com/?pli=1, as shown below.

Smooth GCM to FCM transition

Anyone have experience with it? I'm investigating migrating, but as we already have the app released with GCM, with thousands of users and thousands of notifications daily, I'm reluctant for fear of disrupting existing service. Did anyone manage a smooth transition?
Specifically, in the tutorial (https://developers.google.com/cloud-messaging/android/android-migrate-fcm) step one is 'Import Google Project'. Is this a one-way operation? Will existing GCM server solution and deployed GCM apps continue to work?
Or is the best bet to create a new project, and maintain two server solutions until the GCM deployed apps are phased out?
Importing your Google project into Firebase is a one way operation, however this is not a destructive operation, your current project will have required APIs turned on and necessary API keys will be generated for use with Firebase, but you can still manage that project from the Google Developer console if you decide not to continue using Firebase.
Your present server solutions will continue to work as before. I would go with importing your project to Firebase. It will be much easier than having to migrate your backend to a new project.
note:
If you were using pre InstanceID tokens for device IDs then they will not work in the Firebase console or with topics. So you would have to maintain a mapping of which users you can send to using the Firebase console and/or topics. If your were using GCM with InstanceID then there is nothing to do since FCM also uses InstanceID. You can use the FCM REST API to send to ALL tokens, InstanceID or pre InstanceID.
Be sure not to use GCM and FCM libs in the same client app. You can find issues when generating tokens and handling received messages.
First test out, There are many things to take care in FCM.
Major issues :
White Notification Icon while app is in background or killed.
App hangs after opening closing multiple times.
Read these issues to decide:
Firebase push notifications update DB
https://stackoverflow.com/a/37626817/1507602
How to handle notification when app in background in Firebase
After Upgrading to Google Play Services 9.0.0, App Hangs in DynamiteModulesC
Notification Icon with the new Firebase Cloud Messaging system

Categories

Resources