IOS: Objective-C: Firebase: is it possible to read cached data for any link first?

@Description:

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

https://xxxxxx.firebaseio.com/friends_list

Now I have included disk persistence , that is, I can cache the data, and also using the code below:

  [FIRDatabase database].persistenceEnabled = YES; 

Now I downloaded the application, and I cached the data to disk using the following code:

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

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

I can cache the data, my question is when there is no Internet, I need to first read the data from disk and display it in my interface.

This happens, but there is a delay. Can anyone help me on this.

Thanks.

+1
source share

All Articles