Closed immersify-studio closed 11 months ago
Sorry for the delay - π€ Whenever I am stuck on usage, I refer to the e2e tests here, which usually serve as a good example of how to use things.
I wonder if the problem is that some of our APIs are async vs firebase-js-sdk? We have to do that in many cases to handle the asynchronous nature of the react-native JS/native bridge
Here is an example using .once
that may serve the purpose for you? I don't think this will result in a change in this package so I'm going to close this, but I do hope this helps and the general pointer to the e2e suite for examples really helps:
Issue
Describe your issue here
I am switching over to react-native-firebase libraries from the web based libraries like firebase/database and have been banging my head on this. From what I can tell, my app is initialized correctly and creates the correct reference to my database. When I print out the reference, it has the correct path to the database where I would like to pull, however, it's a string (i.e. https:///. I would expect this to be a Reference type. In turn, this causes my code to fail when calling .once('value'), claiming this is undefined. Is there anything why this would return a string instead of a Reference object?
Project Files
Javascript
Click To Expand
#### `package.json`: ```json { "@react-native-firebase/analytics": "18.4.0", "@react-native-firebase/app": "18.4.0", "@react-native-firebase/database": "18.4.0", "@react-native-firebase/auth": "18.4.0", "@react-native-firebase/crashlytics": "18.4.0", "@react-native-firebase/dynamic-links": "18.4.0", "@react-native-firebase/firestore": "18.4.0", "@react-native-firebase/functions": "18.4.0", "@react-native-firebase/messaging": "18.4.0", "@react-native-firebase/remote-config": "18.4.0", "@react-native-firebase/storage": "18.4.0" } ``` #### `firebase.json` for react-native-firebase v6: ```json # N/A ```
iOS
Click To Expand
#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby # N/A ``` #### `AppDelegate.m`: ```objc // N/A ```
Android
Click To Expand
#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [X] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```
Environment
Click To Expand
**`react-native info` output:** ``` OUTPUT GOES HERE ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [X] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - `e.g. 18.4.0` - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `Y` & `5.1.6`
React Native Firebase
andInvertase
on Twitter for updates on the library.