0
    String FirebaseRefer        =   "path";
    DatabaseReference unitRef   =   FirebaseDatabase.getInstance().getReference(FirebaseRefer);
    unitRef.keepSynced(true);
    unitRef.setValue("Submitted",new DatabaseReference.CompletionListener() {
        @Override
        public void onComplete(DatabaseError databaseError, DatabaseReference dataRef) {
            if (databaseError != null) {
            }
        });

The Firebase callback method never gets called when internet is not there, but it works as soon as internet comes back. I think Firebase supports offline behaviour. So why does this happen?

Note:- I have already given:-

    FirebaseDatabase.getInstance().setPersistenceEnabled(true);
ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
Sreekanth Karumanaghat
  • 3,383
  • 6
  • 44
  • 72
  • https://firebase.google.com/docs/database/android/offline-capabilities – Gowthaman M Jan 09 '18 at 10:58
  • The completion listener is (by definition) only called once the data has been committed to the server. See https://stackoverflow.com/questions/47600083/firebase-mobile-connection-testing-issues-for-android/47601378#47601378, https://stackoverflow.com/questions/37184941/firebase-offline-no-completionlistener-on-setvalue – Frank van Puffelen Jan 09 '18 at 15:02

0 Answers0