Can I use both GCM and FCM in my app?

2019-04-11 10:33发布

问题:

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.

回答1:

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



回答2:

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!



回答3:

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



回答4:

Sorry for the bad news but google has announced that GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019 ( it's not a recommendation but obligation.)as result youre application will not work after 11 april 2019 so you have to Migrate GCM apps to Firebase Cloud Messaging (FCM) and you don't need to change much things in your server side.

you can check this for more informations https://developers.google.com/cloud-messaging/ https://developers.google.com/cloud-messaging/android/android-migrate-fcm

have a nice day..