7

I am trying to turn off persistence for an activity but I am getting the message above. Here is how I am configuring the settings in onCreate():

        mFirestore = FirebaseFirestore.getInstance();
        FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder().setPersistenceEnabled(false).build();
        mFirestore.setFirestoreSettings(settings);

Where do I call this if not right after?

andrewedgar
  • 797
  • 1
  • 12
  • 46

1 Answers1

1

Looks like you have to set the settings in your very first activity when your app opens and have them persist throughout.

andrewedgar
  • 797
  • 1
  • 12
  • 46
  • 1
    Any ideas on how to inline check this for an app that can follow less linear UI flows? (For instance a deeplink that opens C and then user backs up from C->B->A, but A wasn't initially launched and that is where the settings are? Filtering all opens through a Splash/Activity_0 which sets the Firestore settings is not as efficient as a simple inline check that prevents an app crash.) – Mr.Drew Aug 18 '19 at 07:38