marinofaggiana 4 anni fa
parent
commit
0b5bd52cc7
1 ha cambiato i file con 4 aggiunte e 6 eliminazioni
  1. 4 6
      iOSClient/Networking/NCAutoUpload.swift

+ 4 - 6
iOSClient/Networking/NCAutoUpload.swift

@@ -76,12 +76,10 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
     }
     
     func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
-        NCAskAuthorization.shared.askAuthorizationLocationManager() { (hasFullPermissions) in
-            if !hasFullPermissions {
-                NCManageDatabase.shared.setAccountAutoUploadProperty("autoUploadBackground", state: false)
-                self.stopSignificantChangeUpdates()
-            }
-        }
+        if CLLocationManager.authorizationStatus() != CLAuthorizationStatus.authorizedAlways {
+            NCManageDatabase.shared.setAccountAutoUploadProperty("autoUploadBackground", state: false)
+            self.stopSignificantChangeUpdates()
+        } 
     }
     
     func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {