swift - When Standard Location Service and Significant Location Changes are used together, What`s happen?
问题描述
Simultaneous use of Standard Location Service and Significant Location Change.
I’m trying to develop App using Location Information. Can Standard Location Service and Significant Location Changes be used together? I currently use Standard Location Service in the main. However, Even when the app is in not running state, I want to use a location service in my app. So I am trying to use not only Significant Location Changes but also Standard Location Service.
Then some questions came up,
When Standard Location Service and Significant Location Changes are used simultaneously, what`s happening? Do the two functions work simultaneously? Does only one function work? Assumption
If only one function works, which one will work?
If the two functions work simultaneously, Is there a problem with battery consumption?
解决方案
The significant-change location service offers a more power-friendly alternative for apps that need location data but do not need frequent updates or the precision of GPS. This can run when the application is in foreground, background or not running state. So if your application does not need very frequent locations updates then you can use this. FYI it delivers location updates to your app only when the user’s position changes by a significant amount, such as 500 meters or more.
Standard location service will work when the application is running in foreground state and background state(when the back ground mode for location is enabled) only. As soon as the application will get killed(by user or iOS) the standard location service will stop working.
For this you have to set the significant location change service which will wake your application in the background and provide the location updates to your application.
So you should analyse the functionality in your application and check the required frequency of the location and decide your implementation.
Both do not work simultaneously. Only one will work according to the application's requirement and application state.
Both services will work according to the previously mentioned.
They do not work simultaneously. But if you choose significant location changes to implement then it will be far more battery efficient but the location fetching accuracy will be very low.
推荐阅读
- arrays - 使用二分搜索查找最大子数组
- node.js - Electron:无法从另一个 .js 文件访问 main.js
- php - 在类中调用函数而不在 PHP 中使用变量
- javascript - npm run deploy 脚本没有给出链接
- javascript - 用动态输入计算时间
- google-apps-script - 向 Apps Script API 发出请求时,将 Apps 脚本部署为具有给定版本的 API Executable 会引发错误?
- python - 从字典创建字典列表的更多pythonic方法,其中列表元素是形式为`{v:[k1,k2,k3]}`的字典
- javascript - 如果我使用 defaultChecked,排序表列不会改变复选框的位置
- google-closure-compiler - 命令行编译生成的文件比在线版本大
- r - 使用 ggplot geom_smooth 使多条平滑线相对于置信区间填充更加明显