Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

How to run a function when app goes to background or died and stop it when comes to foreground (react-native)?

$
0
0

I want to fetchdata from server when my app closed (in background || died) and stop fetching when it again opened.

So I need to call a function right after app goes to backgroundstate or even force closed (died) and stop it when comes again to foreground.

How can I do it with react-native to be work on both Android and IOS?

I prefer if it is possible without any third party libs, because most third party libs are not maintained in long term.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>