firebase / firebase/geofire-objc

Query didn't return result

Open
#77 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
447
Forks
183
PR merge metrics
No merged PRs in 30d

Description

I have a list of stores as below:
```
"store" : {
"2" : {
"address" : "amman",
"ctime" : "17:05:00",
"g" : "9q8yyxfgs8",
"id" : "11",
"l" : [ 31.9453666, 35.9283716 ],
"name" : "Kaluti",
"otime" : "00:00:00",
"phone" : "0795080034",
"userId" : "4"
},
"7" : {
"address" : "amman",
"ctime" : "01:00:00",
"g" : "9q8yyxfgs8",
"id" : "7",
"l" : [ 31.9453666, 35.9283716 ],
"name" : "Zalloum33",
"otime" : "05:00:00",
"phone" : "0795080034",
"userId" : "2"
},
"11" : {
"address" : "amman",
"ctime" : "17:05:00",
"g" : "9q8yyxfgs8",
"id" : "11",
"l" : [ 31.9453666, 35.9283716 ],
"name" : "Kaluti",
"otime" : "00:00:00",
"phone" : "0795080034",
"userId" : "4"
},
"12" : {
"address" : "asd",
"ctime" : "22:00:00",
"g" : "9q8yyxfgs8",
"id" : "12",
"l" : [ 37.7922, -122.4056973 ],
"name" : "Amam",
"otime" : "10:00:00",
"phone" : "0795126776",
"userId" : "4"
},
"19" : {
".priority" : "9q8yyxfgs8",
"g" : "9q8yyxfgs8",
"id" : "10",
"l" : [ 37.7922, -122.4056973 ],
"name" : "ahmad"
}
}
```

when I try to fetch this location with this code the query didn't return any value

```
let center = CLLocation(latitude: 31.97375, longitude: 35.872316)

if let circleQuery = geoFire?.query(at: center, withRadius: 1.0) {
_ = circleQuery.observe(.keyEntered) { (key, location) in
print("Key '\(key)' entered the search area and is at location '\(location)'")
}

circleQuery.observeReady{
print("All initial data has been loaded and events have been fired for circle query!")
}
}
```

but if I try to use the same code and just change the CLLocation with
let center = CLLocation(latitude: 37.7832889, longitude: -122.4056973)
it's return data.

please advice me where's the problem??

Contributor guide

Open the contributing guide

Research direction

Start at the GeoFire query entry point shown in the issue, comparing the stored location values with the two CLLocation centers and the 1.0 radius. Observe both keyEntered and observeReady while checking the query result for the Amman coordinates; done means determining why that query returns no keys and documenting or correcting the identified behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, swift
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.