database ref's doesnt trigger after i reload the app.
I went through the patch and i upgraded react native firebase package to 5.1.0 but its not working. Its happening in Android physical and emulator phones and i am working in windows environment.
package.json dependencies.
    "react": "16.5.0",
    "react-native": "0.57.0",
    "react-native-firebase": "^5.1.0",
N/A
ios/Podfile:# N/A
AppDelegate.m:N/A
// N/A
android/build.gradle:// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext {
        buildToolsVersion = "28.0.2"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        classpath 'com.google.gms:google-services:4.0.1'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}
allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}
task wrapper(type: Wrapper) {
    gradleVersion = '4.6'
    distributionUrl = distributionUrl.replace("bin", "all")
}
// N/A
android/app/build.gradle:dependencies {
    implementation  project(':react-native-image-picker')
    implementation project(':react-native-firebase')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
//React Native contacts wrapper
implementation project(':react-native-contacts-wrapper')
// Firebase dependencies
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.firebase:firebase-core:16.0.4"
implementation "com.google.firebase:firebase-auth:16.0.5"
implementation "com.google.firebase:firebase-database:16.0.4"
implementation "com.google.firebase:firebase-storage:16.0.4"
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}
apply plugin: 'com.google.gms.google-services'
// N/A
android/settings.gradle:N/A
// N/A
MainApplication.java:N/A
// N/A
AndroidManifest.xml:N/A
<!-- N/A -->
ADD_SOMETHING_HERE e.g. iOS 10 or Android API 28N/AN/AN/AADD_SOMETHING_HERE e.g. Xcode 10, Android Studio 3.2React Native version:ADD_SOMETHING_HEREReact Native Firebase library version:ADD_SOMETHING_HEREFirebase module(s) you're using that has the issue:TypeScript?N/AExpoKit?ExpoKitN/A
Think react-native-firebase is great? Please consider supporting the project with any of the below:
React Native Firebase and Invertase on Twitter@gvetsa I don't know if it helps, but I had the same issue, upgraded build tools and gradle as explained in the release notes, but it didn't fix the issue until I uninstalled the app from my phone, cleaned all intermediate gradle build files, and rebuilt the app. It seems to work for me now.
Edit: actually, scrap that, sorry. I still have the issue, but only with Live Reload.
Sorry, it is my coding issue. It is working. Closing the issue.
@gvetsa can you share what your mistake was? It might help me (and others?) fix my problem :)
@laurentS As per your request, this is what happened with my code.Its a silly coding mistake on my side.
i am using redux-persist to save the data on the device. i have two routes defined in my code.
1) If the User is not authenticated, then authenticate and then create listeners for listening to changes from firebase
2) If the user is authenticated, fetch the data from device Async storage and register for listener for any upcoming messages.
The part i missed is i forgot to re-register for listeners on reload. So i am not getting any messages or changes from firebase.
@laurentS As per your request, this is what happened with my code.Its a silly coding mistake on my side.
i am using redux-persist to save the data on the device. i have two routes defined in my code.
- If the User is not authenticated, then authenticate and then create listeners for listening to changes from firebase
 - If the user is authenticated, fetch the data from device Async storage and register for listener for any upcoming messages.
 
The part i missed is i forgot to re-register for listeners on reload. So i am not getting any messages or changes from firebase.
Can you please explain how did you re-register listeners?