Firebase auto repairs to Android

Here is my code:

    firebaseRef.getRoot().child(".info/connected").addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot snapshot) {
            if (snapshot.getValue(Boolean.class)) {
                // We're connected (or reconnected)! Set up our presence state.
                firebaseRef.child("child").setValue("value");

            }
        }

        @Override public void onCancelled() { }
    });

      

Child path safety rule:

".write": (auth != null);

      

When a client disconnects, it is assumed to reconnect to setValue("value");

.

It works great on JS SDK.

However, the Java SDK seems to have a reconnect issue. It cannot be setValue("value")

there and Firebase returns an error Permission denied

.

Something is wrong? Please help. Thank!

+2


source to share


1 answer


This was actually a bug in the Firebase SDK. It was fixed in version 1.0.10 which can be downloaded here: https://www.firebase.com/docs/downloads.html



+3


source







All Articles