蒙太奇地区的不一致性

时间:2015-11-19 13:49:58

标签: ios iphone

我们在iOS中开发了一个建筑项目应用程序,项目经理可以邀请用户在该建筑项目中工作。每当特定项目的链接用户/项目经理到达项目站点位置时,我们都会向他们发送通知,告诉他们在进入站点之前观看站点安全视频。如果用户看过这些视频,那么我们在下次进入项目位置时不会再向这些用户发送这些通知。这一切都很好。

现在,我们在此应用中添加了一项新功能,可以在这些用户输入项目站点位置时对其进行标记。为此我们使用了Geofencing功能,我们为附近的用户位置项目创建地理围栏,一旦用户输入特定项目地理围栏,我们将其标记为已签入(具有进入时间),并且在退出地理围栏时,用户将被标记签出时(退出时间)。如果我们将iOS应用程序保留在后台(如果应用程序在最近的应用程序中保持打开状态),这可以100%工作,但是当应用程序关闭时(如果应用程序已从最近的应用程序中删除),它始终不起作用。我们也尝试过重要区域监控,但没有在所有用户的结果中获得任何一致性。

所以我们的问题是iOS在应用关闭时支持此GPS通话,意味着我们可以在应用关闭时从应用中执行任何代码(从最近的应用中移除)吗?如果是,那么准确度是多少,因为当应用程序关闭时,我们的GPS代码调用不能100%工作?

我在Geofencs的代码在这里: -

func locationManager(manager: CLLocationManager, monitoringDidFailForRegion region: CLRegion?, withError error: NSError) {
    NSLog("Monitoring failed for region with identifier: \(region!.identifier) Error: \(error.description)")
    if let region = region as? CLCircularRegion
    {
        self.locationMngr.stopMonitoringForRegion(region)
        self.locationMngr.startMonitoringForRegion(region)
    }
}

func locationManager(manager: CLLocationManager, didFailWithError error: NSError) {
    NSLog("Location Manager failed with the following error: \(error)")
}

func locationManager(manager: CLLocationManager!, didEnterRegion region: CLRegion!) {
    println("Entered Region \(region.identifier)")
    if let region = region as? CLCircularRegion
    {
       // Send region.identifier(Project ID) to server with User ID for CHECK-IN
    }
}

func locationManager(manager: CLLocationManager!, didExitRegion region: CLRegion!) {
    println("Exited Region \(region.identifier)")
    if let region = region as? CLCircularRegion
    {
       // Send region.identifier(Project ID) to server with User ID for CHECK-OUT        }
}

func locationManager(manager: CLLocationManager!, didStartMonitoringForRegion region: CLRegion!) {
     NSLog("***Starting monitoring****** \(region.identifier)")
}

func locationManager(manager: CLLocationManager!, didDetermineState state: CLRegionState, forRegion region: CLRegion!) {

    if state == CLRegionState.Inside {
        //// Send region.identifier(Project ID) to server with User ID for CHECK-IN 
    }else{
        NSLog("STATE is OUT of region");
    }
}

0 个答案:

没有答案