Handling Offline Mode in React Native - Deepstash

Bite‑sized knowledge

to upgrade

your career

Ideas from books, articles & podcasts.

published 5 ideas

Handling Offline Mode in React Native

around25.com

  1. The user should be notice if the app si offline and be informed in a screen if that feature is not available
  2. The offline features should be synced with the server once back online

STASHED IN:

3

When back online, you should sync the server with the offline actions. To do so, you should maintain a queue with all the API requests, for executing when the connection will be restored. This queue should be persisted in redux, to remain after several offline sessions

2

STASHED IN:

3

To implement the concepts presented above, you need some help from libraries like Redux-Persist and Netinfo. Redux-Persist will help when launching the app, to populate the Redux with data from the previous session, checking the black and white lists. Netinfo can be used to check the status of th...

STASHED IN:

3

When trying to make a POST, the local state should be updated and Redux should check the internet connection, to see if should make the api request or add it to the queue.

Notice: The modified data should be persisted, so there won't be any discrepancies between sessions

STASHED IN:

3

If there is no internet connection, the data should be extracted from the local storage. Otherwise, a fetch request will be made, including a timestamp, with the last sync with the server. The server will than reply with the updated data and the timestamp will be updated, representing a checkpoin...

STASHED IN:

3

0 Comments

Discover and save more ideas by creating a

FREE

Deepstash account.

Develop a

reading habit

, save

time

and create an amazing

knowledge library

.

GET THE APP:

❤️ Brainstash Inc.