我有用户的当前位置。我可以匹配用户是否在循环内的半径。
我已经在应用程序的前台和后台做了。但我想在终止的应用程序中执行此操作。当用户靠近我的特定点时,进入我的区域后如何弹出警报?!!?
最佳答案
应用程序的后台或终止状态
/*
* 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/