I used the @react-native-firebase/firestore package for my React native app. I have installed my firebase/app as well and followed all the installation steps in the firebase web page. But I am not able to store data into my firestore. Here's the code I have used.
import firestore from '@react-native-firebase/firestore';
export const storeData = async (userDetails) => {
let userName = userDetails.userName;
let storeSuccess = await firestore()
.collection('Users')
.doc('123')
.set({
username: userDetails.userName,
userselfie: userDetails.userSelfie,
LP: userDetails.LPImage,
bill: userDetails.BillImage,
customercontact: userDetails.customerContact,
date: userDetails.date,
time: userDetails.time,
})
.then(() => console.log('success'))
.catch((error) => {
error.message && alert(error.message);
console.log(
'Something went wrong while adding user data to firestore: ',
error,
);
return 'error';
});
return storeSuccess;
};
I have done everything and the above function is even getting called but I get a {"_U": 0, "_V": 0, "_W": null, "_X": null}
as a response from the firestore function.