Should only stop relevant regions
asowers1 opened this issue · 3 comments
asowers1 commented
When BackgroundLocationManager
calls ClearRegions
, all monitored locations in CoreLocation
are being stopped. If users creates a RegionConfig
with less than the maximum region per sandboxed app (20), then any other regions that app was monitoring via CoreLocation
would also be stopped.
fileprivate func clearRegions() {
locationManager.monitoredRegions.forEach { region in
locationManager.stopMonitoring(for: region)
}
}
candangios commented
app not working when backdround:
` if launchOptions?[UIApplicationLaunchOptionsKey.location] != nil {
// BackgroundDebug().write(string: "UIApplicationLaunchOptionsLocationKey")
backgroundLocationManager.startBackground() { result in
if case let .Success(location) = result {
// LocationLogger().writeLocationToFile(location: location)
if DataManager.shareManager.currentAccount != nil{
NetworkManager.shareManager.postSEND_LOCATION(phone:(DataManager.shareManager.currentAccount?.PHONE)! , longitude: String(location.coordinate.longitude), latitude:String(location.coordinate.latitude)) { (success, _, _) in
print(success)
}
}
}
}
}`
yawboafo commented
@candangios any solution for your problem im facing the same