I am working on dating app, In which match(Male/Female) will be done when they will crossed each other by 20 meter radius. Same as Happen App.
The Approach i have used startMonitoringSignificantLocationChanges and regionMonitoring. With creating region and implement these delegate
func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) {
print("Entered Region")
}
func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) {
print("Exited Region")
locationManager?.stopMonitoring(for: region)
//Start location manager and fetch current location
locationManager?.startUpdatingLocation()
}
But finally, Want to get a solution for someone other user, When he/she will cross me.
Note : App is running or not running. This thing dosen't make any sense. App should be work on terminated state also.