Closed swafsarl closed 5 years ago
i think u may just update this:
internal func childAdded(_ snapshot: DocumentSnapshot?)
@swafsarl I would also be interested in this feature. If there is some way I can contribute I would love to help! 👍
Hello, in fact, i have found a workaround based on GeoFirestore code, here what i did: https://pastebin.com/Bz1YJLgZ
Don't forget to import GeoFire
in order to use GFGeoHashQuery
I have copied the GeoFirestore.swift in my project folder.
Well, it works, but i havent spent more time on this task, but we could of course clean the code and get rid of the queries?.forEach
But it does the job, of course, for every change we receive all the items in the mentioned Radius around the center location. While GeoFire tries to only send incremental updates.
If you have a clean solution, we humbly request that you fork the repo and submit a pull request to help out the community.
I have done some changes in geofirestore.swift file.
internal func fireStoreQueryForGeoHashQuery(query: GFGeoHashQuery) -> Query {
var queryFireStore : Query?
queryFireStore = self.myGeofirestore.query
queryFireStore = queryFireStore?.order(by: "g")
queryFireStore = queryFireStore?.order(by: PUBLISHED_DATE_TIME, descending: true)
queryFireStore = queryFireStore?.whereField("g", isGreaterThanOrEqualTo: query.startValue).whereField("g", isLessThanOrEqualTo: query.endValue)
return queryFireStore!
}
I have also change public typealias GFSQueryResultBlock = (String?, CLLocation?, DocumentSnapshot?) -> Void
to get whole document and these changes working fine.
I am facing issue in result data, like i am passing radius of 10 Km, in a result it displays the data greater than that radius.
If anyone can help me it will be great help. Thanks in advance.
internal func fireStoreQueryForGeoHashQuery(query: GFGeoHashQuery) -> Query { var queryFireStore : Query? queryFireStore = self.myGeofirestore.query queryFireStore = queryFireStore?.order(by: "g") queryFireStore = queryFireStore?.order(by: PUBLISHED_DATE_TIME, descending: true) queryFireStore = queryFireStore?.whereField("g", isGreaterThanOrEqualTo: query.startValue).whereField("g", isLessThanOrEqualTo: query.endValue) return queryFireStore! }
I have also change public typealias GFSQueryResultBlock = (String?, CLLocation?, DocumentSnapshot?) -> Void to get whole document and these changes working fine. I am facing issue in result data, like i am passing radius of 10 Km, in a result it displays the data greater than that radius. If anyone can help me it will be great help. Thanks in advance.
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
response_container_BBPPID{font-family: initial; font-size:initial; color: initial;} The Link between degrees and km dépends on where you are located on earth. When u say "greater", how greater It is? Like thé error is about 1% ? 5% ? 10% ? In other words, when u say 10km radius It is merely aproximative distance. Envoyé de mon BlackBerry - l'appareil mobile le plus sécurisé De: notifications@github.comEnvoyé: 17 septembre 2018 14:54À: GeoFirestore-iOS@noreply.github.comRépondre à: reply@reply.github.comCc: info@swaf.ch; mention@noreply.github.comObjet: Re: [imperiumlabs/GeoFirestore-iOS] Simple, and highly useful feature request (#5) I have done some changes in geofirestore.swift file. internal func fireStoreQueryForGeoHashQuery(query: GFGeoHashQuery) -> Query { var queryFireStore : Query? queryFireStore = self.myGeofirestore.query queryFireStore = queryFireStore?.order(by: "g") queryFireStore = queryFireStore?.order(by: PUBLISHED_DATE_TIME, descending: true) queryFireStore = queryFireStore?.whereField("g", isGreaterThanOrEqualTo: query.startValue).whereField("g", isLessThanOrEqualTo: query.endValue) return queryFireStore! } I have also change public typealias GFSQueryResultBlock = (String?, CLLocation?, DocumentSnapshot?) -> Void to get whole document and these changes working fine. I am facing issue in result data, like i am passing radius of 10 Km, in a result it displays the data greater than that radius. If anyone can help me it will be great help. Thanks in advance. —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
Thank you for the quick reply. The location is 25Km away than the current location, and if I set radius of 10Km to my current location and fire a query, that 25Km location is also displaying :-(
Thank you for the quick reply. The location is 25Km far than the current location, and if I set radius 10Km on my current location and fire a query that 25Km location is also displaying.
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
response_container_BBPPID{font-family: initial; font-size:initial; color: initial;} Seems It is displaying all thé locations available ignoring thé location. Am i wrong ? Envoyé de mon BlackBerry - l'appareil mobile le plus sécurisé De: notifications@github.comEnvoyé: 17 septembre 2018 15:31À: GeoFirestore-iOS@noreply.github.comRépondre à: reply@reply.github.comCc: info@swaf.ch; mention@noreply.github.comObjet: Re: [imperiumlabs/GeoFirestore-iOS] Simple, and highly useful feature request (#5) #response_container_BBPPID{font-family: initial; font-size:initial; color: initial;} The Link between degrees and km dépends on where you are located on earth. When u say "greater", how greater It is? Like thé error is about 1% ? 5% ? 10% ? In other words, when u say 10km radius It is merely aproximative distance. Envoyé de mon BlackBerry - l'appareil mobile le plus sécurisé De: notifications@github.comEnvoyé: 17 septembre 2018 14:54À: GeoFirestore-iOS@noreply.github.comRépondre à: reply@reply.github.comCc: info@swaf.ch; mention@noreply.github.comObjet: Re: [imperiumlabs/GeoFirestore-iOS] Simple, and highly useful feature request (#5) I have done some changes in geofirestore.swift file. internal func fireStoreQueryForGeoHashQuery(query: GFGeoHashQuery) -> Query { var queryFireStore : Query? queryFireStore = self.myGeofirestore.query queryFireStore = queryFireStore?.order(by: "g") queryFireStore = queryFireStore?.order(by: PUBLISHED_DATE_TIME, descending: true) queryFireStore = queryFireStore?.whereField("g", isGreaterThanOrEqualTo: query.startValue).whereField("g", isLessThanOrEqualTo: query.endValue) return queryFireStore! } I have also change public typealias GFSQueryResultBlock = (String?, CLLocation?, DocumentSnapshot?) -> Void to get whole document and these changes working fine. I am facing issue in result data, like i am passing radius of 10 Km, in a result it displays the data greater than that radius. If anyone can help me it will be great help. Thanks in advance. —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread. Thank you for the quick reply. The location is 25Km far than the current location, and if I set radius 10Km on my current location and fire a query that 25Km location is also displaying. —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
No actually if set radius to 8Km and fire a query then that location is not coming in result.. so query is working but not perfectly.
No actually if set radius to 8Km and fire a query then that location is not coming in result.. so query is working but not perfectly.
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
Regarding the query radius issue posted above, I had a similar problem of getting all the location ignoring the search radius. I modified the updateLocationInfo function as follows, and it is working fine now. info?.isInQuery != nil --> info?.isInQuery == true
Hi @RvAgrawal
Sorry did you work it out? Have you tried @Gokugokuman's suggestion?
OK so I just tried based on what you guys discussed, changed the type of GFSQueryResultBlock from String(DocumentID) to DocumentSnapshot, and fixed the "isInQuery" check: https://github.com/scm573/GeoFirestore-iOS/pull/1/files Pretty enough for our team now but I cannot say it would fit everyone's requirements...
@scm573 Yes issue resolved now.. Thanks.
Hello, i already use Geofire With Firebase Realtime database on android and i don't know why on android there is the "data event" feature ( https://github.com/imperiumlabs/GeoFirestore-Android#data-events ) and not present on iOS. I really need the data in the whole document not only the Location.
In fact i have many other parameter in the document where i set the geofire location., and when i execute a query to find who is in a certain geoCircle, i still need to check if those "returned results" comply with the other criterias
My question is: are you planning on adding "data events" support for iOS ? other wise i will have to retrieve all document ID and do a firestore query with every single id to check if those documents comply with the other criterias than location. And according to firstore pricing scheme, u know this way of doing this is a deal breaker. I am waiting for response. Keep up the good work
Cheers