ios - iOS 如何知道用户来到了特定位置? [既不在后台也不在前景]

标签 ios iphone swift core-location

我有用户的当前位置。我可以匹配用户是否在循环内的半径。

我已经在应用程序的前台和后台做了。但我想在终止的应用程序中执行此操作。当用户靠近我的特定点时,进入我的区域后如何弹出警报?!!?

最佳答案

应用程序的后台或终止状态

/*
 *  startMonitoringSignificantLocationChanges
 *
 *  Discussion:
 *      Start monitoring significant location changes.  The behavior of this service is not affected by the desiredAccuracy
 *      or distanceFilter properties.  Locations will be delivered through the same delegate callback as the standard
 *      location service.
 *
 */
@available(iOS 4.0, *)
open func startMonitoringSignificantLocationChanges()

使用 CLRegion 进行地理围栏 - 跟踪用户进入该区域和离开该区域的天气

  let region = CLCircularRegion(center: geotification.coordinate, radius: geotification.radius, identifier: geotification.identifier)

  region.notifyOnEntry = (geotification.eventType == .onEntry)
  region.notifyOnExit = !region.notifyOnEntry

关于ios - iOS 如何知道用户来到了特定位置? [既不在后台也不在前景],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51890061/

相关文章:

iOS:Coredatabooks:更改 UITableview

c++ - 在 Objective-C++ 中编码时应该使用 ARC 吗?

iphone - iPhone 是否支持 WiFi ad-hoc 模式?

iphone - UITableView 在彼此之上添加重复标签

ios - 如何检测 UIPickerView 的变化?

ios - Deezer SDK IOS 按 id 播放轨道

swift - 以编程方式添加约束会导致崩溃

ios - UIAnimate 只在按钮上发生一次

ios - AES 加密算法无法解密少数文档格式

ios - 停止 AudioUnit 录制后出现错误