Cancel requests when react native app is in background #4066
Unanswered
MCanhisares
asked this question in
Q&A
Replies: 1 comment
-
@MCanhisares Any success ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have an use case on my app where, after receiving a push notification and pressing an action, the app stays in background but api requests are still executed.
Since iOS is really inconsistent with apps launching on background, most threads are killed by the OS until the app goes on foreground. This is why I'm trying to create a handler that cancels the requests made through the react-query client while the app is on background.
I'm trying to use
focusManager
to achieve such effect, but I'm still stuck. I'm trying to replicate something in the effects of creating a global axios interceptor that reads if the app is on background before deciding to execute the queryany ideas how that would look like?? thanks!
Beta Was this translation helpful? Give feedback.
All reactions