MichaelSolati / geofirestore-js

Location-based querying and filtering using Firebase Firestore.
https://geofirestore.com
MIT License
505 stars 58 forks source link

The query made with geofirestore in the environment of react native and expo when the application is compiled APK Android, it seems that it does not work. #91

Closed georgeMorales closed 5 years ago

georgeMorales commented 5 years ago

I have a prototype with expo and firebase firestore, everything works perfectly in the android emulator and in the physical device with the expo client, however when I compile the application and get the apk, everything works fine except a geospatial query that I do with the geofirestore library, as I said before in the emulator and the device with the client expo the query makes it perfect. Does anyone know what may be happening? Why does it not work when it compiles?? Help please! Thank you! " expo": "^30.0.2"

MichaelSolati commented 5 years ago

Can you provide sample code, or a simple application that replicates your issue? This library doesn't "support" React Native per se, but I'm willing to take a look and see how I can help

georgeMorales commented 5 years ago

Ohh thanks... What does not enter my mind is that it works perfectly in the android emulator of android studio or in my physical device with the client expo and when it is compiled and the apk is obtained it does not work. That is very weird! I'm on it!

georgeMorales commented 5 years ago

Hello @MichaelSolati After doing many tests I have been able to solve the problem. I put together a small project with the latest sdk expo and latest sdk version of web firebase and it worked, it worked well in the emulator and in the physical device when compiling the apk. In my project it was more complex because it had a good amount of dependencies, I updated to the last sdk of expo 32, updated firebase 5.9.0 and some more libraries so that everything fit and there were no failures and luckily it worked :) It was very rare that in development in the android emulator worked well and compiled not, the geofirex library did not have that problem in expo sdk 30 ... But hey, very happy that I can continue working. Thank you! This is the repo link of the example app with expo, it's very simple ... https://github.com/JorgeMoralesLopez/Tests-geofirestore-in-expo Regards!

MichaelSolati commented 5 years ago

So is it safe to say that you resolved the issue yourself? (Can I close the issue?)

georgeMorales commented 5 years ago

Yes, you can close the problem! Thank you!

kdlogan19 commented 4 years ago

Hey, I am going through the same kind of problem. I am trying to use geofirestore for geo-queries in my react-native app. I have Firestore DB already in place (Initialized in my App.tsx). Simple add command doesn't seem to work. It would be great if you can help me out.

const doc = {
      name: 'name',
      age: "age",
      coordinates: new firebase.firestore.GeoPoint(50, 50),
        };
    const geofirestore = new GeoFirestore(firebase.firestore());
    const geocollection = geofirestore.collection("users");

    await geocollection.add(doc).then(async (docRef) => {
            console.log(docRef);
        });

Thanks

MichaelSolati commented 4 years ago

Have you tried chaining a catch to see if it logs an error?

kdlogan19 commented 4 years ago

I don't get any error, so it doesn't print but when I fire a "get" query, it says below: Capture

MichaelSolati commented 4 years ago

I'd need to see a minimum reproducible repo. Unfortunately RNF can make this more complicated.