flutter_geofire
flutter_geofire copied to clipboard
Geofire query is run on old location path, even after initialising it with a new location path.
Hi, I'm getting this issues while querying a new path in a session.
I have made 2 sites for storing the location of male & female separately. When a user wants to see only male in their location as per their initial selection, the query is run successfully and returns male in the given radius. But if the selection is changed to female, and Geofire is initialised to a new location path where female locations are stored..The query is still run on the pervious initialised location, and returns ids for male location rather than female. Though the query return correct data on path initialised at first, either male or female.
Example code:
if(userInterest == male) await Geofire.initialize(LocationBySex/male); else if (userInterest == female) await Geofire.initialize(LocationBySex/female);*/ try { Geofire.queryAtLocation(location.latitude, location.longitude, dynamicRadius).listen((map) {....}
Has anyone tried to fix this as I am having the same issue?
hey guys, could you solve it? @prasundubey @gbrain2001 @mrdishant
Have you tried removing the listener and then initializing again? bool response = await Geofire.stopListener();
Hi @mrdishant, we're running into the same problem. After using queryAtLocation().listen(), we canceled the StreamSubscription, called Geofire.stopListener() and ensured the correct execution order using a mutex before calling Geofire.initialize() again with a different path. However, any new queries will still run on the old path.
same issue here. the listener keeps use the old location . we need this issue to be solved!