Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebase geofirestore v9 not working #231

Closed
andresfmm opened this issue Mar 13, 2022 · 1 comment
Closed

firebase geofirestore v9 not working #231

andresfmm opened this issue Mar 13, 2022 · 1 comment

Comments

@andresfmm
Copy link

andresfmm commented Mar 13, 2022

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
Copy link
Owner

Support for the modular firestore library doesn't exist yet, see here, for now you need to use the compat library.

Modular support is being worked on, see here.

I'm closing this issue in favor of #219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants