'Get data from Firebase Realtime Database stopped working in React Native

I created a React Native application that uses Firebase for authentication and for database. My piece of code that returns data from database:

database.ref('/Membership').on('value', querySnapShot => {
            let array = []
            let data = querySnapShot.val()
            let keys = Object.keys(data)
            keys.forEach(key => {
                array.push(data[key])
            })

            setMemberships(array)
        })

My database:

enter image description here

My problem is that this piece of code worked for my data, but it stopped working. Database in still on, I have access to it, it throws no error.

I don't know what's the problem because there is no error thrown. If I try to console.log the database.ref('/Membership') it gets the correct path, but on the on function nothing happens, not even a console.log.

The version of firebase used is "^9.6.10"

Can somebody help me? Thank you for your time!

Edit with solution

Sorry for creating a post, but maybe will help someone one day.

With some kind of update (or I don't know why), my database rules have been changed so I had no permission to write or read. So I changed them back to true and it's working.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source