我是 Firebase 存储的新手。如何发送要存储在 Firebase 中的 map 信息(纬度、经度、半径)?信息将从用户放置在 map 上的图钉中收集。然后该用户会将其发送给另一个用户。只有发送方和接收方才能看到的信息。每个用户都应该能够将多个位置发送给不同的人。这不是他们当前的位置。而是发送用户选择的位置。
最佳答案
此代码假设您已经检索到您的用户坐标。如果您有任何其他问题,请告诉我
let currentUserLocation = myLocation.coordinate
let coords: [String: Double] = [
"lat": self.currentUserLocation!.latitude,
"long": self.currentUserLocation!.longitude,
]
let currentUser = FIRAuth.auth()?.currentUser?.uid
self.dbFir.child("users/\(currentUser!)/").updateChildValues(coords, withCompletionBlock: { (error, dbFir) in
if error != nil {
error?.localizedDescription
} else {
}
})
关于ios - 上传 map 信息到 Firebase - iOS Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38470737/