简体   繁体   English

应用终止后如何获取更新的位置信息?

[英]How can we get updated location after app is terminated?

We have used 我们已经使用

significantLocationChange ( https://developer.apple.com/documentation/corelocation/getting_the_user_s_location/using_the_significant_change_location_service ) significantLocationChange 更改https://developer.apple.com/documentation/corelocation/getting_the_user_s_location/using_the_significant_change_location_service

for update location but it gives location update sometimes and so it is not consistenly giving the location update. 用于更新位置,但有时会提供位置更新,因此不会一致地提供位置更新。

What is the best way to get updated location frequently when app is in terminated stage (not in foreground / not in background) 当应用处于终止阶段(不在前台/不在后台)时,频繁获取更新位置的最佳方法是什么?

You have to enable Background modes for Location updates for your app. 您必须为应用程序的位置更新启用后台模式。 You can do this by selecting your Project -> Capabilities -> Background Modes and enable Location updates. 您可以通过选择项目->功能->后台模式并启用位置更新来执行此操作。

There is no way to do that, IMHO. 恕我直言,没有办法做到这一点。 If the app is terminated you will get no frequent updates, it was the users choice to terminate your app and Apple respects this. 如果该应用程序终止,您将不会获得频繁的更新,这是用户选择终止您的应用程序的选择,Apple对此予以尊重。 iOS does not collect location data in the background and handles it over to your app when your app is started again. iOS不会在后台收集位置数据,而是在再次启动应用程序时将其处理到您的应用程序中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 除了重要的位置更新,应用程序终止后还有其他方法获取位置吗? - Other than significant location update , is there any other way get location after app is terminated? 终止后继续位置进入模拟器但不在真实设备中 - Continues location get in simulator but not in real device after terminated 即使应用程序在 iOS 中终止,我们还能运行后台任务吗 - Can we run background task even app is terminated in iOS 如何在应用程序终止然后在 Xcode 中重新打开后对其进行调试? - How to Debug an app after it is terminated and then reopened in Xcode? 应用终止时更新位置 - Update Location when app is terminated Swift - 即使应用程序终止,如何使用 URLSession 发送位置 - Swift - How to send location with URLSession even if the App is terminated 即使应用程序终止,如何在 Flutter 中添加实时位置跟踪? - How to add live location tracking in Flutter even app is terminated? 即使应用程序终止,iOS 9 如何获取位置 - iOS 9 how get locations even if app terminated 如何获取和发送位置(即使应用程序终止或暂停)到服务器 - How to get and send location(even if application is terminated or suspended) to server 如何在ios中以终止状态获取每200米的位置 - How to get location on each 200 meters in terminated state in ios
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM