Answer the question
In order to leave comments, you need to log in
How to make data loading in the background in react-native + expo?
You need to constantly load data and display it on the screen.
now the data is simply loaded into componentDidmount and if the data on the server has changed, you need to click on the button.
you need to add automatic data loading and make the component rerender.
Answer the question
In order to leave comments, you need to log in
you have several options
1 is to do date push. Send keys to your phone by which you will understand what you need to catch or just update everything.
2 is to pull the request when moving, for example, to another screen and minimize the deployment of the application. This request should send the time of the last request to the server. On the server, you need to compare the time of the last request, and the current time, and if changes have occurred during this time, then return the keys by which you need to update part of the application, or completely. This approach has already been implemented and it works.
You may ask why not hang up some background worker that will time out to request changes - the main problem is that after a certain time, the OS simply stops your application.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question