parse.com geoPointForCurrentLocationInBackground 是否算作 API 请求

Does a parse.com geoPointForCurrentLocationInBackground count as an API request

有谁知道 PFGeoPoint.geoPointForCurrentLocationInBackground 的实现是否算作 API 解析请求,即它会计入我每秒 30 个请求的限制吗?看到通过 CLLocationManager 查找 iPhone 的位置不使用任何网络请求,我认为它不会。

Tim 实际上,您使用 Parse 所做的任何事情都将计入您的 API 请求限制。看看他们作为一家企业的情况,他们从 API request/s 中收取收入。所以显然你做得越多对他们越好。如果您查看他们对什么构成 API 请求的定义,您会看到一个非常模糊但明确的答案。 see here具体第一题供参考。

Anytime you make a network call to Parse on behalf of your app using one of the Parse SDKs or REST API, it counts as an API request.

所以看看你的代码,你在后台调用了一些东西,所以是的,如果你从 Parse 中获取它,你会 然而 在这种情况下它正在使用设备您在问题中提到的位置。 CLLocationManager 委托传递新坐标,所有 geoPointForCurrentLocationInBackground 所做的就是封装它。 此外,为了回答您的评论,查询也属于此范围。

作为一个安全的赌注,假设您的所有任务都使用 API 请求,这将养成更好的编码习惯和更智能的结构大纲。

我相信唯一没有对您不利的是缓存信息,这是有道理的,因为您最初已经通过初始查询检索了信息,因此无需使用另一个 API 请求来获取与缓存相同的数据。

旁注:这甚至适用于新的本地数据存储,即使它在技术上不在线,它也会更新您创建本地数据存储的后端 query/save。


参考https://parse.com/docs/ios/api/Classes/PFGeoPoint.html#//api/name/geoPointForCurrentLocationInBackground

我已经通过将以下代码放入没有其他解析 api 请求的视图控制器中进行了测试

PFGeoPoint.geoPointForCurrentLocationInBackground { (g: PFGeoPoint!, e: NSError!) -> Void in
        PFGeoPoint.geoPointForCurrentLocationInBackground { (g: PFGeoPoint!, e: NSError!) -> Void in
            PFGeoPoint.geoPointForCurrentLocationInBackground { (g: PFGeoPoint!, e: NSError!) -> Void in
                PFGeoPoint.geoPointForCurrentLocationInBackground { (g: PFGeoPoint!, e: NSError!) -> Void in
                    PFGeoPoint.geoPointForCurrentLocationInBackground { (g: PFGeoPoint!, e: NSError!) -> Void in
                        PFGeoPoint.geoPointForCurrentLocationInBackground { (g: PFGeoPoint!, e: NSError!) -> Void in
                            PFGeoPoint.geoPointForCurrentLocationInBackground { (g: PFGeoPoint!, e: NSError!) -> Void in
                                println(g)
                            }
                        }
                    }
                }
            }
        }
    }

此应用分析页面上的性能选项卡上没有显示任何内容,因此我建议这是 "free" API。我已经给他们发了邮件确认