Link existing Firebase and Google Cloud projects - android

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.

Related

GCM without using Firebase

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.

Create new server keys in GCM after September 2016

How to register a new Server key in the GCM after September 2016?
Yes, I understand that the registration of new keys in the GCM is prohibited.
Starting from September 2016, you can create new server keys only in
the Firebase Console using the Cloud Messaging tab of the Settings
panel. Existing projects that need to create a new server key can be
imported in the Firebase console without affecting their existing
configuration.
But our company policy does not allow the use of FCM.
Perhaps Google office can help?
There is no other way to generate a valid Server key to use for GCM or FCM, other than using the one auto-generated one when you create/migrate a Firebase Project in the Firebase Console.
As mentioned in the comments, using a Server Key retrieved from the Firebase Console can still be used by implementations for GCM. Using this technically doesn't mean that you're using FCM already.
Also mentioned in the comments, FCM is practically just GCM itself with new features. It is already strongly recommended that users of GCM migrate to using FCM already.
If you're still persistent on not using a Server Key from generating a Firebase Project, I suggest contacting GCM Support through this form, providing the details as to why you need to generate a new Server Key.

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.

What is difference between Google Cloud Messaging(GCM) and Firebase Cloud Messaging(FCM)? [duplicate]

This question already exists:
FCM Vs GCM? Why we need to migrate from GCM to FCM [duplicate]
Closed 6 years ago.
What is difference between Google Cloud Messaging(GCM) and Firebase Cloud Messaging(FCM)?
FCM (Firebase Cloud Messaging) is a improved version of the Google Cloud Messaging API & it have all features of GCM with some additional features also. Google just announced that Google Cloud Messaging is now Firebase Cloud Messaging.
Differences between FCM and GCM
Firebase Cloud Platform inherits GCM’s core infrastructure but simplifies the client development. Developers no longer needs to write their own registration or subscription retry logic. Now, you can integrate FCM in your app with just a few lines of code.
Plus, FCM includes a web console called Firebase Notifications that reminds me of Parse Push Console.
Google Cloud Messaging (GCM) part of Firebase Cloud Messaging (FCM). 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.
FCM is the new version of GCM, it inherits GCM' core infrastructure.
Here the excerpt from Firebase support FAQ:
FCM is the new version of GCM under the Firebase brand. It inherits
GCM’s core infrastructure, with new SDKs to make Cloud Messaging
development easier.
Benefits of upgrading to FCM SDK include:
Simpler client development. You no longer have to write your own
registration or subscription retry logic. An out-of-the-box
notification solution. You can use Firebase Notifications, a
serverless notifications solution with a web console that lets anyone
send notifications to target specific audiences based on Firebase
Analytics insights. To upgrade from GCM SDKs to FCM SDKs, see the
guides for migrating Android and iOS apps.
Read more Firebase FAQ

Migration from GCM to FCM needed?

Google just announced that Google Cloud Messaging is now Firebase Cloud Messaging. What does this mean for existing users of GCM and what migration (if any) are needed?
What is FCM and why should we use it?
FCM (Firebase Cloud Messaging) is a new, improved version of the Google Cloud Messaging API under the Firebase brand. It has all the features of GCM as well as some additional features. Per the Firebase FAQ, it "inherits GCM’s core infrastructure, with new SDKs to make Cloud Messaging development easier". Google explained their decision to release FCM in their Cloud Messaging FAQ, where they wrote:
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
Google recommends upgrading from GCM to FCM in their APIs for Android Release Notes. Reasons for doing so are given in the Firebase FAQ:
Benefits of upgrading to FCM SDK include:
Simpler client development. You no longer have to write your own registration or subscription retry logic.
An out-of-the-box notification solution. You can use Firebase Notifications, a serverless notifications solution with a web console that lets anyone send notifications to target specific audiences based on Firebase Analytics insights.
Is GCM deprecated?
Some features of GCM are already deprecated (see https://developers.google.com/cloud-messaging/android/legacy-regid, for example) and now in the coming days GCM is going to be fully deprecated. Google says:
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.
How to update old Android applications from GCM to FCM
From https://developers.google.com/cloud-messaging/android/android-migrate-fcm:
Import your GCM project as a Firebase project:
In the Firebase console, select Import Google Project.
Select your GCM project from the list of existing projects and select
Add Firebase.
In the Firebase welcome screen, select Add Firebase to your Android
App.
Provide your package name and SHA-1, and select Add App. A new
google-services.json file for your Firebase app is downloaded.
Select Continue and follow the detailed instructions for adding the
Google Services plugin in Android Studio.
Update: There was a recent announcement via email that GCM is now deprecated and will be completely removed next year (2019), and all GCM users should start migrating to FCM. For more details, see my answer here.
In addition to what Pritam Baral's answer, note that FCM's core is composed of GCM itself. There is no actual need to migrate to it, but it is encouraged, since when migrated to FCM, all of the features tied to it will be available for use. When referring to the Firebase Official Pricings Page, the features that are included for free are:
Analytics, App Indexing, Authentication, Dynamic Links, FCM, Invites, Notifications, Crash Reporting, & Remote Config
Pre-IO GCM implementations should still work for a longer time in the future, as stated in the GCM and FCM FAQs:
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.
As per the recent highlights:
Firebase Cloud Messaging builds on and improves the Google Cloud Messaging API. You can keep using Google Cloud Messaging with com.google.android.gms.gcm, but we recommend upgrading to com.google.firebase:firebase-messaging.
The cloud infrastructure will mostly remain the same, so existing GCM apps should continue to work fine. Although I haven't found any mention of a deprecation policy from Google yet, it would be unusual for Google to (and they have little reason to) break existing GCM infrastructure/SDK/code.
FCM seems like a better version of GCM, being available on multiple platforms (even web!) and simpler to setup (compare to GCM). Migration guides are available for Android and iOS
Google 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.
FCM
it is advance/improved version of GCM but with new brandname Firebase
very easy/Simplified client development
Server-less console where anyone can send notifications to specific device
Notification payload: 4KB, Message payload: 2KB. Note that the notification includes device and app information too.
Stores 100 notification/messages per device if the device is offline.
Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits
the reliable and scalable GCM infrastructure, plus new features! See
the FAQ to learn more. 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.
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.
Yes some features of GCM is deprecated, but they are supporting all previous clients.
To upgrade from GCM SDKs to FCM SDKs, please see the guides for migrating Android
For more information.https://developers.google.com/cloud-messaging/faq

Categories

Resources