Can't Disable Offline Data In Firestore

前端 未结 4 740
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-03 06:59

After deleting data from my Firestore Database, it takes my Android app some time to realize that the data was deleted, and I assume t

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-03 07:59

    // Enable Firestore logging
        FirebaseFirestore.setLoggingEnabled(flase);
    // Firestore
        mFirestore = FirebaseFirestore.getInstance();
    

    In general: the Firebase client tries to minimize the number of times it downloads data. But it also tries to minimize the amount of memory/disk space it uses.

    The exact behavior depends on many things, such as whether the another listener has remained active on that location and whether you're using disk persistence. If you have two listeners for the same (or overlapping) data, updates will only be downloaded once. But if you remove the last listener for a location, the data for that location is removed from the (memory and/or disk) cache.

    Without seeing a complete piece of code, it's hard to tell what will happen in your case.

    Alternatively: you can check for yourself by enabling Firebase's logging [Firebase setLoggingEnabled:YES];

    try this For FireBase DataBase

      mDatabase.getReference().keepSynced(false);      
          FirebaseDatabase.getInstance().setPersistenceEnabled(false);
    

提交回复
热议问题