firebase geofirestore v9 not working
andresfmm opened this issue · 1 comments
andresfmm commented
hi michael hou are you?
this code not working firebase is working but geofirestore return TypeError: undefined is not a function
firebase web sdk with react native
import { initializeApp } from "firebase/app";
import {
getFirestore,
initializeFirestore,
collection,
addDoc,
getDocs } from "@firebase/firestore";
import { getAuth, signInWithEmailAndPassword } from "firebase/auth";
const firebaseConfig = {
apiKey: "xxx",
authDomain: "xxx",
databaseURL: "xxx",
projectId: "xxx",
storageBucket: "xxx",
messagingSenderId: "xxx",
appId: "xxx",
measurementId: "xxx"
};
const app = initializeApp(firebaseConfig);
const db = initializeFirestore(app, {
experimentalForceLongPolling: true
})
const GeoFirestore = geofirestore.initializeApp(db);
export {
db,
getDocs,
collection,
getAuth,
signInWithEmailAndPassword,
GeoFirestore
}
error here the error is undefine the code break here stop here
const geocollection = await GeoFirestore.collection('users').where("status", "==", status)
const geoQuery = geocollection.near({
center: new db.GeoPoint(latitude, longitude),
radius: 10,
});
// Get query (as Promise)
const idcollection = await geoQuery.get();
i hope some one can help me
thanks a lot
MichaelSolati commented