Tag: geofire

在iOS移动应用程序中将Geofire与Firebase一起使用

在本文中,我们将学习Firebase和GeoFire。 以下是我们将在本文中讨论的要点。 1)什么是Firebase? 2)如何在iOS应用程序中使用Firebase? 3)Firebase提供的服务。 4)什么是地火? 5)如何将iOS中的GeoFire与Example集成在一起? 如果您对Firebase有所了解,那么对本文的理解将更加容易。 好吧,我们将首先从Firebase开始,然后我们将了解Geofire在iOS移动应用程序中的作用。 火力地堡: 什么是Firebase? Firebase是一项移动后端即服务,它提供了许多功能,可用于构建功能强大的移动应用程序。 Firebase提供的服务如下所述: Firebase服务: 实时数据库 认证方式 分析工具 动态链接 云储存 测试实验室 邀请 AdWords 崩溃报告 云功能 云消息传递 远程配置 代管 性能监控 应用索引 AdMob 从上述所有功能中,实时数据库是最独特,最有趣的功能。 之所以称为实时数据库,是因为无论何时在数据库中进行任何更新,所有用户都无需交互即可在其移动应用程序中获取真实数据。 我们将通过一个示例来了解实时数据同步。 在详细介绍示例之前,我们将首先了解如何注册使用Firebase iOS SDK。 以下是相同的步骤, iOS应用程序中的Firebase集成: 打开https://firebase.google.com/登录到您的google帐户,然后打开以下网址https://firebase.google.com/docs/,您会发现详细信息,如下图所示。 从上图提到的选项中选择“ iOS入门”。 选择相同的页面后,您将找到一个页面,其中逐步包含有关如何使用Firebase的所有信息。 但是,为了您的简单起见,我在这里也提到了所有步骤。 如果您还没有Xcode项目,请立即创建一个。 如果您没有Podfile,请创建一个: $ cd your-project目录 $ pod init 添加您要安装的Pod。 您可以像这样在您的Podfile中包含Pod: pod“ Firebase […]

GeoFire给CocoaPods带来问题

我正在尝试将Geofire添加到使用Google Firebase作为后端的iOS项目中。 当我添加Geofire pod并运行pod update我在terminal中收到此消息… [!] Unable to satisfy the following requirements: – `Firebase` required by `Podfile` – `Firebase (~> 2.1)` required by `GeoFire (1.1.0)` Specs satisfying the `Firebase, Firebase (~> 2.1)` dependency were found, but they required a higher minimum deployment target. 这是我的Podfile看起来像… # Uncomment this line to define a global platform for your […]

与iOS上的FlutterFire和原生GeoFire插件冲突

当我尝试将GeoFire添加到包含FlutterFire数据库插件的iOS Flutter项目时,出现错误。 这是错误的样子: Resolving dependencies of `Podfile` [!] Unable to satisfy the following requirements: – `Firebase (~> 2.1)` required by `GeoFire (1.1.0)` Specs satisfying the `Firebase (~> 2.1)` dependency were found, but they required a higher minimum deployment target. 我的podspec文件看起来像这样的atm: # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name […]

使用Firebase和GeoFire以Radius检索位置数据

我正在尝试使用GeoFire检索并根据半径(例如,距离10km的所有内容)。 为了保持清晰,我在数据库中分别保存了细节和位置,所以细节的id与位置的id是一样的。 在保存数据的同时,我使用: var details = ["a":"a", "b":"b", etc] let checkpointRef = eventRef.childByAutoId() checkpointRef.setValue(details) let checkpointId = checkpointRef.key let geofireRef = ref.childByAppendingPath("checkpointLocations") let geoFire = GeoFire(firebaseRef: geofireRef) geoFire.setLocation(CLLocation(latitude: usersLatitude, longitude: userLongitude), forKey: checkpointId) {… 在这之前,数据库中的一切似乎都很好。 在获取数据的同时,从核心位置获取用户的纬度和经度后,我试图: func retrieve() { let geofireRef = Firebase(url: self.baseurl + "/checkpointLocations") let geoFire = GeoFire(firebaseRef: geofireRef) let center = CLLocation(latitude: […]