Skip to content
Advertisement

Firebase Verify Badge [closed]

I have implemented a function that has to show verify badge on my app user profile if I change the rule from Firebase real-time database but badge doesn’t appear even after making rules true view my Rules in Firebase

Code I used in my app to show badge:

if (_childValue.containsKey("Verify")) {
        Verify = _childValue.get("Verify").toString();
        if (Verify.equals("True")) {
            verifyimg.setVisibility(View.VISIBLE);
        }
        else {
            verifyimg.setVisibility(View.INVISIBLE);
        }
    }

Advertisement

Answer

The code used in the app was

if (_childValue.containsKey("Verify")) {
        Verify = _childValue.get("Verify").toString();
        if (Verify.equals("True")) {
            verifyimg.setVisibility(View.VISIBLE);
        }
        else {
            verifyimg.setVisibility(View.INVISIBLE);
        }
    }

Where T of True was Capital and the T used in firebase rule was small t

To make project work either make T capital in Firebase or change your code used in app to

if (_childValue.containsKey("Verify")) {
        Verify = _childValue.get("Verify").toString();
        if (Verify.equals("true")) {
            verifyimg.setVisibility(View.VISIBLE);
        }
        else {
            verifyimg.setVisibility(View.INVISIBLE);
        }
    }
Advertisement