ios - 上传 map 信息到 Firebase - iOS Swift

标签 ios swift firebase firebase-realtime-database firebase-storage

我是 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/

相关文章:

objective-c - 无法在 Swift 中调用 Objective-C 方法

Angular 5 AngularFire Firebase 登录闪烁

ios - 隐藏/显示 UITabBarController 的 .tabBar(用于 Root View Controller )

ios - 快速添加谷歌地图 View ?

ios - TransformedValueClass 返回 AnyObject 类型的数组

objective-c - 我可以自定义现有的 viewWithTag :(NSInteger) method for stringTag?

firebase - 获取单项 firebase

Firebase 函数 : Unclear "connection error"

ios - 测试飞行 - 本地网络权限,TestFlight 构建中出现 NSBonjourServices 错误

ios - 团队中的项目太少