I am using flutter fcm notifications. The code setup is done exactly as recommended on their page. The onConfigure method contains callback functions for onMessage, onResume and onLaunch.
I have a user preference in the app where the user can disable notifications temporarily. This means even if the notification comes to the phone, I should not show it in the system tray or it should not popup. Unsubscribing from the topics is not an option as there are too many topics and it would get difficult to subscribe again if the user decides to enable notifications
What I want is to simply by pass the notification when the app is in background. I tried returning null in the onResume or setting the message parameter to empty, but the notification still comes. Is there any other way I can reliably set some condition where the notification stops coming