Aph*_*ire 6 gps xamarin.ios ios xamarin
我目前正在使用此处的Xamarin地理位置插件:
https://github.com/jamesmontemagno/GeolocatorPlugin
在我使用Xamarin Forms(PCL)构建的应用程序中执行位置服务.我相信我已经添加了相关的权限设置以允许这个.
应用程序处于活动状态并锁定时,GPS工作正常(但应用程序位于前台).然而,当通过单击"主页"按钮将应用程序推送到iOS的后台时,它仍会跟踪用户并突出显示"应用程序正在使用您的位置"消息,正如我所期望的那样,但是在30-之后的一定时间之后40分钟后,此消息消失,GPS似乎停止跟踪用户,直到他们将应用程序带回前台.
一旦应用程序被带到前台,它可以再次背景另外30-40分钟重复循环.
我确保定位器对象允许后台更新:
public static Plugin.Geolocator.Abstractions.IGeolocator locator;
locator = CrossGeolocator.Current;
locator.AllowsBackgroundUpdates = true;
locator.DesiredAccuracy = 20;
Run Code Online (Sandbox Code Playgroud)
调用.PausesLocationUpdatesAutomatically显示这是假的(我相信这是默认值).
编辑
我有以下info.plist键:
NSLocationWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
Run Code Online (Sandbox Code Playgroud)
并启用后台位置更新:
但是我没有启用背景提取,因为Girish在答案中,这是我需要做的事情吗?
| 归档时间: |
|
| 查看次数: |
709 次 |
| 最近记录: |