I have this dependencies:
"react-native": "0.62.2",
"@react-native-firebase/app": "^7.0.1",
"@react-native-firebase/firestore": "^7.0.1",
In my project I have done rnfirebase structure on my existing project from this url: react native firebase
I have added this:
buildscript {
dependencies {
// ... other dependencies
classpath 'com.google.gms:google-services:4.2.0'
// Add me --- /\
}
}
To my build.gradle
And this:
apply plugin: 'com.google.gms.google-services'
To my app/build.gradle also placed downloaded google-services.json from firebase console in /app directory
Then I have used firestore package like this:
import firestore from '@react-native-firebase/firestore';
useEffect(() => {
console.log('on load');
firestore()
.collection('users')
.add({
name: 'Hello firebase',
})
.then(() => {
console.log('success');
})
.catch(err => console.log(err, 'error'));
});
In my app, but noting appears no xhr connection made in react native debugger no console log error or success! Nothing!
I have done uninstall rnfirebase/app and rnfirebase/firestore packages and uninstalled then rebuild app by react-native run-android but nothing happened!