Open jcampana opened 8 years ago
@jcampana I've tried this on a project and ended up using CouchDB instead, as Firebase.Xamarin doesn't support Offline Database
@jcampana I managed to make it work offline. Firebase Xamarin is a rewrite of Firebase Database, so I'm using the original implementation of Offline database as my Offline Database Factory.
My constructor now looks like this: `var _instance = new FirebaseClient(
@talihomz
Can you share sample app?
which uses
var _instance = new FirebaseClient( <My Firebase Url>, (t, s) => new OfflineDatabase(t, s) );
Because when i use it, it gives this error--
Object reference not set to an instance of an object. at Lex.Db.DbInstance.Initialize ()
That means I have to include a new offline database? like this Lex.DB? and it will work correctly? the framework check if the internet returns and load the offlineDatabase that was include in your example?
@pallavbohara I have some problem. How you fix it?
@talihomz The original implementation of Offline database that you linked to no longer exists.
For anyone looking to implement this:
1) Save the OfflineDatabase.cs class found here to your project: https://github.com/step-up-labs/firebase-database-dotnet/blob/021d00a08373f535af93d66944404719be86ee58/src/Firebase/Offline/OfflineDatabase.cs
2) Install LiteDB from nuget
3) Use var firebase = new FirebaseClient(
I am not sure when but at some point the offline database stopped working. It seems that there is a HttpRequestException thrown when trying to make a call to the database if not online. For some reason it is not attempting to use the offline database instance when it fails to connect to the server.
Hey there @zanesc any updates on this issue?
I tried to enable Offline database for get data when network connection is not available. Is it possible with this framework? Not? Any solution for this?
Thanks