marinofaggiana há 4 anos atrás
pai
commit
0b5bd52cc7
1 ficheiros alterados com 4 adições e 6 exclusões
  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) {