我有用户的当前位置。而且我可以匹配用户是否循环内的半径。
我在应用程序的前景和背景中进行过操作。但是我想在终止的应用程序中做。当用户靠近我的特定点时,一旦进入我的区域,如何弹出警报?!?
答案 0 :(得分:0)
用于应用程序的后台或终止状态
/*
* 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进行GeoFencing -跟踪天气用户进入该区域内并离开该区域
let region = CLCircularRegion(center: geotification.coordinate, radius: geotification.radius, identifier: geotification.identifier)
region.notifyOnEntry = (geotification.eventType == .onEntry)
region.notifyOnExit = !region.notifyOnEntry