PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, September 10, 2022

[FIXED] What is the best way to develop a offline first application in React Native?

 September 10, 2022     android, cross-platform, ios, javascript, react-native     No comments   

Issue

Offline applications is a feature that permits the user to access mobile apps without the Internet.

On my requirement, I would like to create an app that allows users to save data such as pictures and videos while they are offline and upload them when they connect to the internet.

What is the best way to achieve my goal, and what are my data storage options?


Solution

its a good statement,

You can start of by integrating https://github.com/andpor/react-native-sqlite-storage .Its a good offline storage mechanism,

2nd: Im guessing youve already integrated an image picker, so basically now on imagePicker response of selecting an image succesfully, you need to save that URI in sql lite database whenever the user is OFFLINE. WHEn user is ONLINE dont add in SQL lite, instead directly upload those Image URI's to backend

3rd. Now also keep track of all the number of rows in database, whenerv user comes back ONLINE, you can start uploading every row (which contains URI) one by one, and once its done, delete each row in SQL lite

Hope it helps, feel free for doubts



Answered By - Gaurav Roy
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing