iOS位置服务访问和系统频繁定位 [英] iOS Location Services visits and system Frequent Location

查看:191
本文介绍了iOS位置服务访问和系统频繁定位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,在iPhone上频繁定位似乎使用的电池少于监控iOS访问的应用程序( https://developer.apple.com/reference/corelocation/clvisit )。



通过设置 - >隐私 - >位置服务 - >系统服务 - >频繁地点,可以在手机上查看iPhone上的频繁位置。



我想知道,来自CLLocationManager的访问监控服务与iOS常用位置相同,还是位于Apple使用的不同系统上。如果苹果公司使用相同的服务,为什么它不会对电池产生任何影响?解析方案

这两个API是针对不同的



CLLocationManager API



该API旨在根据您的应用程序指示的要求通知您的应用程序位置信息。当您的应用收到位置数据时,您可以选择一些特定的条件,并且您的应用将继续接收该数据,直到不再需要为止。想一想,例如,Uber应用程序会在打开应用程序时请求位置数据,以便您可以安排行程,并在您的行程接近时继续请求。

常用地点 / CLVisit API



相比之下,Frequent Locations它不会一致地向您的应用报告位置数据。相反,应用程序可以表明他们想知道用户是否访问了特定的位置,如果用户这样做,则iOS会通知应用程序。地点往往有些粗糙。这将在StarBucks应用程序的示例中使用,当您到达StarBucks附近时,应用程序可能会告诉您关于附近有限时间销售的商店,以鼓励您停止。对于许多这些应用程序,用户通常会选择一个预先定义的位置列表,他们将标记为他们的最喜欢的地点/商店,应用程序将使用该数据来通知用户。 h2>

由于这两种API的运行方式不同,电池使用的差异变得明显。使用CLLocationManager,我们开始并不断向应用程序报告准确/粗略的位置。除了蜂窝三角网和wifi热点位置数据之外,通常还会使用GPS。



但是对于CLVisit,我们通常只会在首次访问时通知应用程序一次(或离开)期望的位置。由于这个iOS不需要唤醒应用程序,并且如果当前位置没有大致离我们感兴趣的报告更近或更远,则可以执行任何额外的处理。该设备可以使用蜂窝三角测量和wifi热点位置数据获得粗略位置。这种级别的位置细节通常不需要GPS。由于您的蜂窝无线电和WiFi通常是永远在线,因此它不会消耗任何额外的电力来使用这两种方法进行位置检测。但是,它如何使用蜂窝网络和wifi来确定我在哪里?

解释你的设备如何从蜂窝或wifi信号中获得位置超出了这个问题的范围。但是这里有一篇很好的文章,解释了这些信息是如何派生出来的。 Google如何知道我在哪里? - security.stackexchange.com


I noticed that Frequent Location on iPhone seems to use much less battery than an app monitoring iOS Visits (https://developer.apple.com/reference/corelocation/clvisit).

Frequent location on iPhone can be viewed on the phone via Settings -> Privacy -> Location Services -> System Services -> Frequent Locations.

I would like to know if Visit monitoring service from CLLocationManager is the same as iOS Frequent location or is it on different system used by Apple. If Apple is using the same service why it does not have any impact on the battery?

解决方案

The two APIs are intended for different purposes.

CLLocationManager API

This API is designed to inform your application of location information based on requirements which are indicated by your app. You may choose some specific conditions when your app receives location data, and your app will continue to receive that data until it is no longer desired. Think for example, the Uber app would request location data when opening the app so you can schedule a ride, and would keep requesting it as your ride approaches.

Frequent Locations / CLVisit API

By contrast Frequent Locations is different in that it does not consistently report location data to your app. Instead apps can indicate they want to know if a user visited a specific location, and if the user does then iOS will inform the application. Locations tend to be somewhat rough. This would be used in the example of the StarBucks app, when you arrive near a StarBucks the app may tell you about the nearby shop with a limited time sale to encourage you to stop in. For many of these apps, the user will generally select a pre-defined list of locations which they will mark as their "favorite" locations/stores and the app will use that data to notify the user.

Battery Life

Due to the difference in how both of these APIs operate the difference in battery usage becomes apparent. With CLLocationManager we begin and continuously report either an accurate/rough location to the app. GPS is normally used here in addition to cellular triangulation and wifi hotspot location data.

But with CLVisit, we typically only notify the app a single time upon the initial visit (or departure) of a desired location. Due to this iOS doesn't need to wake the app and do any additional processing if the current location isn't roughly gotten closer or farther away from where we are interested in reporting. The device can get a rough location using cellular triangulation and wifi hotspot location data. GPS is not generally needed for this level of location detail. Since your cellular radio and wifi are usually "always on" it doesn't drain any additional power to use these two methods for location detection.

But how can it use cellular and wifi to determine where I am?

Explaining how your device derives it's location from cellular or wifi signals is beyond the scope of this question. But here is an excellent post explaining a little about how that information is derived. How does Google know where I am? - security.stackexchange.com

这篇关于iOS位置服务访问和系统频繁定位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆