I made a complete app using firebase, expo and react native (with login screen and other features). But it didn't work as I expected because I need an app that the database works offline (I want the user to use the app offline, and then connect to the internet and "update" the data).
In other words, I'm looking for another way. I heard about Realm, but it doesn't work with Expo (from what I've researched). Can anyone guide me to some possibilities??
About the app I'm making: login>selection>release
*the user logs in (offline. The first time can be online, but when entering the app again, the login must be OFFLINE). The next screen is 'selection' (all screens show information of the logged in user), the user writes some information that is saved in a database. When completing the 'selection', the next screen is 'release', in which the user will add information in the same data table (db) before (from the 'selection' screen). The user will not have internet when entering the app (but he can access the internet later and update his data as soon as he connects).
Firebase work offline and import the data when it is online.
Now about the other db that works with expo, if you like working with SQL then there is something I built expo-sqlite-wrapper it is a good ORM and did not find any better.
There is also a JSON based database easy-db-react-native, the downside of this is that you can't have too much data saved.
Related
I'm building a SPA site in React (using redux).
To my site, any user can connect through Google or Facebook.
Each user who logs in to the site receives a personal user_id.
For each user, the system needs to keep a history of documents created by this same user (like the recent docs in Word).
I need to create functionality that whenever the user is logged in he will be able to see a history of the five documents he has created/updated.
In addition, the latest documents will load even after disconnecting and reconnecting to the system.
To load the history into the system I am thinking of using a dedicated index in ElasticSearch.
My question is which way would be suitable the most to use when the user is already logged in and creates several documents one after the other -
Should I need to save everything within the index in ES or is there a smart way to save and update the information locally without producing a lot of calls to DB?
I want that in the end there will be only 2 DB calls that are made in total - one call to load the information on login and one call to update the information when the user logs out. Any other create and update docs will save locally on the client side until leaving the site.
I have an ionic 1 (angularjs) app, which doesn't work offline, on first launch user creates account, logs in and next time he opens app he is already logged in.
The scenario is I am looking for is an offline mode(that is without internet connection), here if the user is not connected to internet he's not allowed to explore the app, here i want to let the user explore the app even without internet connection, with the credentials already logged in.
A lot of resources suggests to use localstorage, but i can't find any relevant resources regarding the same.
I have spent hour reading and testing different approaches but well even more confused than ever. It seems to me as such important feature of hybrid app that there should be a good implementation... Would appreciate any help/suggestions/examples/links...
My ultimate goal would be that once authorized user can access and manipulate his profile data even if in offline mode. That means that opening app allready logs him in an his profile info is stored as well.
My minimum viable goal would be that when app is opened app recognizes user, checks as logged in, redirects to logged in state and makes http to get all user details. While user is waiting for that response there are loading spinners but he can start to use logged in app experience.
Your connection windows is controlling your App. So basing on this, you can easily make a checknetwork function to make it check if you want.
If this function return "false" then you bypass the login if only the user has already logged in.
On your provider for the LogPage, you should control this kind of things with shared values as
let isOnceConnected: boolean;
Hope this help.
bro just store your token generated by the server or user data in local storage, If the user is in the local storage then redirect the page other send it to the login page,
local storage like
to set =>
localStorage.setItem('auth-token', JSON.stringify(access_token));
to get =>
JSON.parse(localStorage.getItem('auth-token'));
Also, you can use Storage plugins to store any data.
I am currently doing a project in which I need to implement a logic when the user posts when offline. For ex. when a user goes offline and he presses Save(to a database on cloud), I don't want those data to be lost, I want those data to be saved as soon as the connection is back.
I have not found anything specific even after hours of search.
Thank you for any suggestion!
You can use NetInfo to check connection status, then if the user is offline, you can store their post using AsyncStorage. Once NetInfo has detected that the device is online again, it can pull from AsyncStorage any posts that were saved, upload them, and clear their keys.
I wanted to save all my data from firebase database into a local database in (JSON format only) for my application to access it when not connected to internet. It consists even images in it along with string form of data.
Firebase allots very less space for offline mode saving data into the application hence can't use it.
I want data to be first saved in my local database and then to be retrieved into the recyclerView of my application.
Moreover I want to save login details as well as other user specific details required to keep the application function without internet into particular user's login.
Searched for answers but no reliable or step by step guide I encountered.
Are these things possible? What should I do ? Please guide.
I am new to Facebook development.
Is it possible to have a website login with Facebook + a non-FB database?
Specifically I would like my users to access Facebook information similar to Sociogram (http://coenraets.org/blog/2013/02/sociogram-a-sample-application-exploring-the-facebook-sdk-and-the-graph-api/) which I have gotten working with my own website app, but also tie in additional user information that Facebook does not keep - so that my users only have to have one login.
Any info on where to start researching would be helpful.
As you are talking about having your own database, i can guide you like this.
Use facebook javascript login to get premissions from user and save them to your database in which you may have other details to be added later for your website purpose
When you save details once from first login, you dont need to save them on next login. So Write code so that on first login check your database for user existance and if not then add him to database.
And in that database you can add extra field that facebook wont save like his height for example.
For this to happen you must have server side scripting knowledge to store the details to database. If you need further more details, i am here to answer.