0
我想为我的swift iOS应用程序在Firebase中创建一个查询。我在查询中遇到的问题是,它不会立即从Firebase获取坐标,除非它们被更改。我尝试了其他观察者类型,但都没有出现。我知道我目前有观察者类型需要更改,但我需要正确的方法,让应用程序加载后立即获取位置,并使用Firebase进行更新。 .childAdded
立即获取位置,但在Firebase上更改时不会更新。我如何才能在Firebase中的现有和新生儿中获得结果?
userDirectory.queryOrderedByChild("receiveJobRequest")
.queryEqualToValue(1)
.observeEventType(.ChildChanged , withBlock: {snapshot in
var cIhelperslatitude = snapshot.value["currentLatitude"]
var cIhelperslongitude = snapshot.value["currentLongitude"]
那应该是要query.observeEventType(*值*在答案的第二部分。 ? – Jay
好的。固定! –