Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCMBroadcastReceiver in oreo(8.0) or up not working

GCMBroadcastReceiver not register using manifest or dynamically

<receiver
            android:name="com.ee.nowmedia.core.pushnotification.PushBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter><!-- Receives the actual messages. -->
                <action android:name="com.google.android.c2dm.intent.RECEIVE" /><!-- Receives the registration id. -->
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="com.ee.nowmedia.core.pushnotification" />
            </intent-filter>
        </receiver>
like image 240
Vishal Dobariya Avatar asked Dec 05 '25 02:12

Vishal Dobariya


1 Answers

As of April 10, 2018, Google has deprecated GCM. The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. Migrate GCM apps to Firebase Cloud Messaging (FCM), which inherits the reliable and scalable GCM infrastructure, plus many new features. See the migration guide to learn more. Read more at Google Cloud Messaging -- DEPRECATED 4/10/2018 documentation

So the code

<receiver
    android:name="com.google.android.gms.gcm.GcmReceiver"
    android:exported="true"
    android:permission="com.google.android.c2dm.permission.SEND" >
    <intent-filter>
        ......
    </intent-filter>
</receiver>

is useless since 8.0 and also after 11Apr2019 for each API.

like image 175
Pankaj Kumar Avatar answered Dec 09 '25 00:12

Pankaj Kumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!