1

@Description:

I have data already exists at some endpoint(friends_list) so this is my reference :

https://xxxxxx.firebaseio.com/friends_list

Now, I have enabled disk persistence i.e., i am allowed to cache the data as well as using the below code:

 [FIRDatabase database].persistenceEnabled = YES;

Now, I have loaded the application and I have cached the data to disk by using the following code:

 FIRDatabaseReference *globalRef = [[FIRDatabase database] reference];

 FIRDatabaseReference *ref = [globalRef child:@"friends_list"];
 [ref keepSynced:YES];

//here comes : other stuff for listeners (ChildAdded, ChildChanged, ChildRemoved)

I am able to cache the data, my question is when there is no internet I have to read the data from disk first and display them in my UI.

This is happening but there is a delay. Can some one help me on this.

Thanks.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • what is lot of delay ? – Shubhank Jun 10 '16 at 07:19
  • I want to run the app with no internet connection, now I am calling the function which triggers /../../friends_list I have delay reading the data from disk.... I am expecting it to read them instantly since I dont have internet connected. – Guntikogula Dinesh Jun 10 '16 at 07:30

0 Answers0