FCM: A way to know when when app is launched or resumed and was not precipitated by a notification click. #5625
Unanswered
safield
asked this question in
Feature request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TLDR: I want to block input after application resume, until I know my firebase callback is not going to change the screen, so as to prevent multiple unintended Nagvigator push calls.
Inside of my onResume MessageHandler, I change the screen using Navigator. So when a notification arrives while the app is in the background, when the user clicks it, the app opens to the relevant screen. A very common pattern.
The issue is that there is a brief period where the screen that previously existed in the foreground is present. After a certain time, the screen then switches.
The subsequent issue is that there is a period (however short) where errant user input could land on the existing screen, before the MessageHandler onResume screen switch occurs. This could result in and unexpected/unintended stack of routes in the Navigator.
The ideal solution would be to block user input when there is a pending notification precipitated screen switch.
All top level screen widgets state flow could be as follows
-> AppLifeycle communicates app onResume to screen widget
-> screen widget enters state InputIgnoredWaitingForNotifcation
then either
->Notifcation MessageHandler onResume changes screen, then communicates to widgets that they can progress from InputIgnoredWaitingForNotifcation.
or
->NEW firebase MessageHandler onResumeNoNotification is called, and no action is taken regarding notification (there isn't one), but like MessageHandler onResume, it is still communicated to the widgets that they can progress from InputIgnoredWaitingForNotifcation.
Beta Was this translation helpful? Give feedback.
All reactions