[英]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.