且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Firebase通知有时会跳过onMessageReceived方法

更新时间:2023-09-18 07:49:22

For the display-messages (messages with notification tag), it's the expected behaviour that the onMessageReceived only called when the app is on foreground.

If you want to use data-messages (message without notification tag), you can't do it via console (at least until this time). You have to manually create post request to FCM server. You can see that post request example from answer to this question How to handle notification when app in background in Firebase.