Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin-IOS-CLLocationManager:在iphone锁定或睡眠时获取位置更新_Ios_Xamarin_Cllocationmanager_Backgrounding - Fatal编程技术网

Xamarin-IOS-CLLocationManager:在iphone锁定或睡眠时获取位置更新

Xamarin-IOS-CLLocationManager:在iphone锁定或睡眠时获取位置更新,ios,xamarin,cllocationmanager,backgrounding,Ios,Xamarin,Cllocationmanager,Backgrounding,我试图找到这些信息,但到目前为止我没有成功。我知道CLLocationManager具有后台功能。它有很好的文档记录。我想知道CLLocationManager是否正确配置为后台接地,即使手机处于锁定和睡眠状态,它是否也会触发标准位置更新?如果是,假设我的应用程序没有被终止,它会唤醒它吗?我可以执行代码来处理位置修复吗?我可以做测试,但我担心我缺乏知识会给我错误或不完整的结论。这就是我问社区的原因 谢谢你的时间 是的,它可以在后台运行 是的,如果你在后台运行它,它会唤醒你的应用程序30秒 是的,

我试图找到这些信息,但到目前为止我没有成功。我知道CLLocationManager具有后台功能。它有很好的文档记录。我想知道CLLocationManager是否正确配置为后台接地,即使手机处于锁定和睡眠状态,它是否也会触发标准位置更新?如果是,假设我的应用程序没有被终止,它会唤醒它吗?我可以执行代码来处理位置修复吗?我可以做测试,但我担心我缺乏知识会给我错误或不完整的结论。这就是我问社区的原因

谢谢你的时间

  • 是的,它可以在后台运行
  • 是的,如果你在后台运行它,它会唤醒你的应用程序30秒
  • 是的,它可以在后台运行
  • 是的,如果你在后台运行它,它会唤醒你的应用程序30秒
  • 您已将
    AllowsBackgroundLocationUpdates
    设置为
    true
    以使其在睡眠或后台模式下工作


    您已将
    AllowsBackgroundLocationUpdates
    设置为
    true
    以使其在睡眠或后台模式下工作

    谢谢。这是否意味着当CLLocationManager触发LocationsUpdated事件时,我有30秒的代码执行时间?我找不到那30秒的文档。你有线索吗?谢谢你的时间,谢谢。这是否意味着当CLLocationManager触发LocationsUpdated事件时,我有30秒的代码执行时间?我找不到那30秒的文档。你有线索吗?感谢您的时间是的,这是我到目前为止拥有的:if(UIDevice.CurrentDevice.CheckSystemVersion(8,0)){locMgr.RequestAlwaysAuthorization();//在后台工作//locMgr.RequestWhenInUseAuthorization();//仅在前台}if(UIDevice.CurrentDevice.CheckSystemVersion(9,0)){locMgr.AllowsBackgroundLocationUpdates=true;}是的,这是我到目前为止拥有的:if(UIDevice.CurrentDevice.CheckSystemVersion(8,0)){locMgr.RequestAlwaysAuthorization();//在后台工作//locMgr.RequestWhenInUseAuthorization();//仅在前台工作}if(UIDevice.CurrentDevice.CheckSystemVersion(9,0)){locMgr.AllowsBackgroundLocationUpdates=true;}
    LocationManager = new CLLocationManager();
    LocationManager.AllowsBackgroundLocationUpdates = true;