Search code examples
javascriptfirebasereact-nativefirebase-realtime-database

React Native Firebase: realtime database listener and set data, push notification no longer triggers


Firebase version

"@react-native-firebase/app": "18.1.0",
"@react-native-firebase/auth": "18.1.0",
"@react-native-firebase/database": "18.1.0",
"@react-native-firebase/messaging": "18.1.0",
"react-native": "0.70.8"

The Firebase project suddenly not working i.e push notification and realtime database (rules write and read are true). Not error thrown whatsoever.

try {
    console.log('fetching');
    
    const snapshot = await database().ref(`/client/5`).once('value');
    console.log('snapshot', snapshot.val());
} catch (error) {
    console.log(error);
} 

If I connect it to a new/different firebase project it works. Don't know what is causing the issue or where else to look. I have gone through google cloud console and I don't know where to look for possible cause.

I tried looking through google cloud console and I am lost as to I am not sure where to look to fix the issue.


Solution

  • I manage to resolve it, due to insecure writing of data, firebase enforced the realtime database found under App Check section. Disabled the enforced option and it is working again.