Android FCM:当应用程序处于后台时 FCM 显示(通知)消息登录

Android FCM: FCM display(notification) message loggin when app is in background

我正在尝试对来自 FCM 的传入消息实施某种日志记录。我们正在使用 FCM display(notification) messages 类型。当应用程序处于 background 时,我正在尝试找到记录传入通知的方法。我知道,如果我使用 FCM Data message 类型,我可以简单地在 onMessageReceived 回调中接收来自 FirebaseMessagingService 的通知,但不幸的是,这是不可能的。

如果 fcm 负载由数据消息组成,它在后台工作。通知消息只会在系统托盘中显示消息[应用程序无法访问该消息]。