Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrating from gcm to fcm on android

I want to migrate from gcm to fcm in android app. Do I need to send push notification to old users of the android app from gcm or i can send it through the new fcm from server?

FCM is working fine I'm able to receive push notifications on my device through fcm but I'm not able to send push notifications to old GCM registration tokens from FCM console.


Below is the code I've added to my manifest file for fcm to work-

<uses-permission android:name="com.google.android.z.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application>
    <service
        android:name=".view.activity.MyFcmListenerService">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <service
        android:name=".view.activity.MyInstanceIDListenerService">
        <intent-filter>
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>
</application>
like image 379
Anmol Avatar asked Jun 24 '16 17:06

Anmol


People also ask

Is FCM and GCM the same?

Firebase Cloud Messaging (FCM), formerly known as Google Cloud Messaging (GCM), is a cross-platform cloud solution for messages and notifications for Android, iOS, and web applications, which as of June 2022 can be used at no cost.

What is difference between GCM and FCM in Android?

A client app is a GCM-enabled app that runs on a device. The app server is the GCM-enabled server that your client app communicates with through GCM. FCM (Firebase Cloud Messaging) is the new unified app platform introduced by Google to replace GCM (Google Cloud Messaging).

Is GCM deprecated?

GCM will be replaced by Firebase Cloud Messaging (FCM), which will inherit the reliable and scalable GCM infrastructure, plus many new features.

Does WhatsApp use GCM?

WhatsApp(and several other Apps) rely upon GCM/FCM(as option 1 - the default) as it is present as a system App on lot of devices and therefore holds a special status where it is very less likely to be killed unlike a normal App. For devices that do not have play services, your custom socket connection is relied upon.


1 Answers

I think you can send it through FCM. To know more about FCM you can check the documentation for frequently asked questions about GCM to FCM. Also if you are starting to migrate from GCM to FCM the you can follow this tutorials:

  • Migrate a GCM Client App for Android to Firebase Cloud Messaging

  • Migrating to FCM from GCM

Also for more information, you can check this SO question.

like image 130
KENdi Avatar answered Nov 03 '22 20:11

KENdi