mrdishant / flutter_geofire

A Flutter plugin to get the realtime updates of places nearby usinf Firebase GeoFire.
MIT License
23 stars 28 forks source link

QueryAtLocation not working after pressing back button. #15

Open luislukas opened 4 years ago

luislukas commented 4 years ago

I've realised that after invoking: Geofire.queryAtLocation(latitude, longitude, radius).listen((map) {} and getting successful results, if you press the back button and then launch the app again, the query won't return any result anymore, even though the @overrid void initState() is called again and the code having the Geofire query is executed. The logs just display: queryAtLocation but then no result comes through. If we kill the app completely then all works fine again. The only work around I found to have results after pressing the back button is to add Geofire.stopListener() after Geofire.onGeoQueryReady. Next time we launch the app it works fine, however, during that app session we won't be listening for any other event since we've stop them which is not ideal. I've tried as well to do Geofire.stopListener() when the lifecycle is paused and initialised Geofire and do the search again when resume but doesn't work. Is this something expected or I'm I doing something wrong?

jesussmile commented 3 years ago

I dong get any results with query. Is it still working for u ?

luislukas commented 3 years ago

Yes, just checked and it still works for me.

jesussmile commented 3 years ago

Thanks got it to work, the problem is with the plugin, I had to move the project to another one with a clean install of the plugin. Same code but clean install got it to work.

Instein125 commented 1 year ago

Thanks got it to work, the problem is with the plugin, I had to move the project to another one with a clean install of the plugin. Same code but clean install got it to work.

I have got the same problem with geofire 2.0.3 version. Which version should i downgrade? How to fix can you explain a bit