Closed michaelkowalski closed 4 years ago
Hey
Are you able to provide a full example of the document you're trying to add to the collection, the stack trace seems to indicate you're doing something with GeoPoint?
@Salakar many thanks! I didn't notice the GeoPoint mentioned in the stack trace... 🤦🏻♂️ That's right, that's the issue. My full code was the following:
await firestore()
.collection('data')
.add({
name,
photoDescription,
comment,
what,
location: firestore.GeoPoint(location.latitude, location.longitude),
accuracy: location.accuracy
})
}, [name, photoDescription, comment, what, location])
EDIT
For anyone coming here with the same issue, that's the proper method of doing this:
import firestore, { firebase } from '@react-native-firebase/firestore'
await firestore()
.collection('data')
.add({
name,
photoDescription,
comment,
what,
location: new firebase.firestore.GeoPoint(location.latitude, location.longitude),
accuracy: location.accuracy
})
I'm using the newest firebase and firestore in my new project:
Installed like this https://invertase.io/oss/react-native-firebase/quick-start/new-project and like this https://invertase.io/oss/react-native-firebase/v6/firestore/quick-start.
I'm importing firestore just like in the examples here: https://invertase.io/oss/react-native-firebase/v6/firestore/quick-start#reading-data. My code:
And I'm getting this warning:
Am I doing something wrong? I removed and installed node_modules, installed the pods, rebuild the project and nothing...