Hey guys!
I am working on an app that communicates with Palantir Foundry as a backend. They do not support streaming like Firebase does so updates that need to happen in "real time" need to be looped in a periodic action.
Here is the issue I am having: So I followed the best practice of starting the periodic action on page load and then stopping it any time a navigate back action would have been invoked so it does not run in the background. However, it appears that on page load does not get called on navigate back (expected behavior, but one that I have had a hard time working around in FlutterFlow specifically). So essentially what ends up happening is the periodic action gets kicked off when the user navigates to the screen needing refreshes, it is turned off when they navigate to another screen, but when they navigate back it is not turned back on because onPageLoad is not ran again.
Any thoughts on how to keep this event consistently being activated when the user navigates to the screen?
Best Way To Handle Periodic Actions
I am sorta getting around this issue right now by having a widget that runs onInit and kicks off the periodic action, but even this does not get called on navigate back consistently and usually requires the user to provide some input to the ui.
2. Typically in my Flutter applications I would have this syncing logic exist at the provider level running independently of the page you are on. However, it looks like Periodic Actions are disabled at the app level- so cant solve it that way.
3. Am tempted to try to route the user through an "landing" screen before entering the app that kicks off the periodic action in the background and then navigates them into the app without stopping the periodic action (And then having logic in the action that only hits the endpoints when my route provider is on a page that needs refresh). However, I am worried if the page gets disposed that the periodic action will stop and there wont really be a way to refresh it.