简体   繁体   English

应用程序未运行时,iOS后台模式?

[英]iOS background mode when app is not running?

Is background mode for receiving location updates available when app was closed? 关闭应用程序后,可以使用后台模式接收位置更新吗? Is it any way to collect and share location data like Friends app ? 有没有办法收集和共享“ Friends app类的位置数据? It shares location always, also when does not runs. 它总是共享位置,甚至在不运行时。

If your app must keep monitoring location even while it's in the background, use the standard location service and specify the location value of the UIBackgroundModes key to continue running in the background and receiving location updates. 如果您的应用程序即使在后台仍必须监视位置,请使用标准位置服务并指定UIBackgroundModes项的位置值以继续在后台运行并接收位置更新。 (In this situation, you should also make sure the location manager's pausesLocationUpdatesAutomatically property is set to YES to help conserve power.) (在这种情况下,您还应该确保将位置管理器的pausesLocationUpdatesAutomatically属性设置为YES,以帮助节省电量。)

If GPS-level accuracy isn't critical for your app and you don't need continuous tracking, you can use the significant-change location service. 如果GPS级别的精度对您的应用而言并不重要,并且您不需要连续跟踪,则可以使用重大变化的位置服务。 It's crucial that you use the significant-change location service correctly, because these updates run continuously, around the clock, until you stop them, and can actually result in higher energy use if not employed effectively. 正确使用重要更改位置服务至关重要,因为这些更新会不停地连续运行,直到您将其停止为止,并且如果不加以有效利用,实际上会导致更高的能耗。

Check out the Location and Maps Programming Guide for more information. 请查看《 位置和地图编程指南》以获取更多信息。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM