3

For our app we need the app the work offline 100% with the most recent data. Normally the app uses a symfony api platform API to fetch data paginated server side.

But when someone is using the app in a area without Internet he still need to be able to access all data to make a new job and que it for when he is online.

So our tough is to make a json that has all the data and send it to the phone when the phone has connection. When the phone is using the app live, it will use pagination from server and fetch data. And when offline it will use the local downloaded data file.

Problem is the data is large, so storing it is the problem.

We are now using redux persist and we see so many people have problems with crashes and mobile ram. We also thought of using sqlite or just async to store a json file, or download a sqlite file from the app.

How do you guys feel about this

1
  • what solution did you opt for ? We are trying to implement something with this exact feature. Commented May 14, 2024 at 19:11

1 Answer 1

1

You can use react-native-local-mongodb. This can help you store a json database on your phone. Other option is to have react-native-sqlite-storage in case your database has to be relational and requires table.

You will have to sync this local copy with the server once this user is online. This too can be done if you have the timestamp saved of the last sync. So after that, you ll just have to sync the data created after that timestamp.

However, I had also implemented react redux persist and it didnt crash. I suppose, the reason for crash must me something else.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.