更新时间: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.