0
Я использую geofire для расположения saving.My кода прилагается ниже, Расположения Saving Кода:запроса для выборки близлежащего местоположения не выполняется
let usersRoot = ref.child("geograpgicalLocationDetails")
let geoFire = GeoFire(firebaseRef: usersRoot.child(userID!))
geoFire?.setLocation(CLLocation(latitude: (self.currentLocation?.latitude)!, longitude:(self.currentLocation?.longitude)!), forKey:"location") { (error) in
if (error != nil) {
print("An error occured: \(error)")
} else {
print("Saved location successfully!")
}
}
Nearby location fetching:
var allKeys = [String:CLLocation]()
let query = geoFire?.query(at: center, withRadius: 0.001)
print("about to query")
query?.observe(GFEventType.init(rawValue: 0)!, with: {(key: String?, location: CLLocation?) in
print("Key: \(key), location \(location?.coordinate.latitude)")
allKeys [key!] = location
})
Моим вопрос местоположение выборка запрос не выполняется, так что я не могу получить результат. Пожалуйста, помогите мне
не выполнять код внутри circleQuery! .observe() query –
@ priya.vr его работающий штраф теперь проверьте его –