Firebase push notification not working

扶醉桌前 提交于 2019-12-05 03:05:35

You should include premission on manifest:

<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> 

<uses-permission android:name="android.permission.WAKE_LOCK" />

Update

No premission are needed anymore, because "all the permissions required by FCM are now added automatically by library"

Instead of "Send Now" in the firebase web console notifications gui try "Send Later" with a time shortly in the future. Send Now may have a bug where it puts the date to send slightly in the past so it never gets sent.

I've tried all the solutions posted here and in other posts but they didn't work for me. I solved by manually uninstalling and reinstalling the app on my device. Hope this help.

Go To https://console.firebase.google.com/ go to menu Notifications. here you can send messages directly to any particular device or all devices or based on topic your customer has subscribed.

and dont forget, I had the same problem and it is solved by defining enabled, exported to true in my service, trying to do like me,..

  <service android:name=".MyFirebaseMessagingService"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT"/>
            </intent-filter>
        </service>
</application>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!