简体   繁体   中英

FCM notification is not received when sent from firebase notification console

I am using Firebase notifications in my application. I have performed all steps mentioned in firebase documentaton. I can also receive the registration token inside onTokenRefresh() method. But when I try to send message to my device from Firebase Notification console, It shows status as 'Completed' next to message, but I don't receive anything on my device even when app is in background.

(copy paste from my other answer )

I had this exact problem, the device behavior was somehow weird. some notifications were received, some not.

In the end I found out what was wrong. My device's Sync setting was off. please check that first and don't waste your time like me. 在此处输入图片说明

You need to call private void sendNotification(String topic); method from Overriden method public void onMessageReceived(RemoteMessage remoteMessage). then your notification will added to notification bar.

Happy Coding.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM