marinofaggiana 4 years ago
parent
commit
e5189c84c5

+ 1 - 1
Cartfile

@@ -1,4 +1,4 @@
-github "nextcloud/ios-communication-library" "v0.77"
+github "nextcloud/ios-communication-library" "develop"
 github "tilltue/TLPhotoPicker" "2.0.12"
 github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
 github "MortimerGoro/MGSwipeTableCell" "1.6.8"

+ 2 - 2
Cartfile.resolved

@@ -8,7 +8,7 @@ github "SwiftyJSON/SwiftyJSON" "5.0.0"
 github "WeTransfer/WeScan" "1.2.0"
 github "WenchaoD/FSCalendar" "2.8.0"
 github "dzenbot/DZNEmptyDataSet" "v1.8.1"
-github "getsentry/sentry-cocoa" "5.2.0"
+github "getsentry/sentry-cocoa" "5.2.1"
 github "huri000/QuickLayout" "3.0.0"
 github "huri000/SwiftEntryKit" "1.2.3"
 github "ivanbruel/MarkdownKit" "1.6"
@@ -18,7 +18,7 @@ github "krzyzanowskim/OpenSSL" "1.0.218"
 github "malcommac/SwiftRichString" "3.7.2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
 github "marinofaggiana/TOPasscodeViewController" "0.0.7"
-github "nextcloud/ios-communication-library" "v0.77"
+github "nextcloud/ios-communication-library" "44d900874a5e6fb96514800545d6f54d575e1f50"
 github "realm/realm-cocoa" "v5.3.5"
 github "rechsteiner/Parchment" "v2.4.0"
 github "scenee/FloatingPanel" "v1.7.5"

+ 8 - 8
Nextcloud.xcodeproj/project.pbxproj

@@ -2217,7 +2217,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2268,7 +2268,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2311,7 +2311,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/Share.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2355,7 +2355,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/Share.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2405,7 +2405,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2455,7 +2455,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2497,7 +2497,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/iOSClient.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2542,7 +2542,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (

+ 8 - 8
iOSClient/AppDelegate.m

@@ -68,7 +68,7 @@
     [[NCCommunicationCommon shared] setupWithDelegate:[NCNetworking shared]];
     [[NCCommunicationCommon shared] setupWithUserAgent:[CCUtility getUserAgent] capabilitiesGroup:[NCBrandOptions sharedInstance].capabilitiesGroups];
     NSInteger logLevel = [CCUtility getLogLevel];
-    [[NCCommunicationCommon shared] setFileLogWithLevel:logLevel];
+    [[NCCommunicationCommon shared] setFileLogWithLevel:logLevel echo:true];
     [[NCCommunicationCommon shared] writeLog:[NSString stringWithFormat:@"%@ %lu", @"[LOG] Start session with level", (unsigned long)logLevel]];
     
     // Set account, if no exists clear all
@@ -248,7 +248,7 @@
 //
 - (void)applicationWillTerminate:(UIApplication *)application
 {    
-    NSLog(@"[LOG] bye bye, Nextcloud !");
+    [[NCCommunicationCommon shared] writeLog:@"[LOG] bye bye"];
 }
 
 #pragma --------------------------------------------------------------------------------------------
@@ -496,8 +496,8 @@
             [[NCCommunication shared] subscribingPushProxyWithProxyServerUrl:proxyServerPath pushToken:self.pushKitToken deviceIdentifier:deviceIdentifier signature:signature publicKey:publicKey userAgent:userAgent completionHandler:^(NSInteger errorCode, NSString *errorDescription) {
                 if (errorCode == 0) {
                     
-                    NSLog(@"[LOG] Subscribed to Push Notification server & proxy successfully.");
-                        
+                    [[NCCommunicationCommon shared] writeLog:@"[LOG] Subscribed to Push Notification server & proxy successfully"];
+
                     [CCUtility setPushNotificationToken:account token:self.pushKitToken];
                     [CCUtility setPushNotificationDeviceIdentifier:account deviceIdentifier:deviceIdentifier];
                     [CCUtility setPushNotificationDeviceIdentifierSignature:account deviceIdentifierSignature:signature];
@@ -525,7 +525,7 @@
             [[NCCommunication shared] unsubscribingPushProxyWithProxyServerUrl:proxyServerPath deviceIdentifier:deviceIdentifier signature:signature publicKey:publicKey userAgent:userAgent completionHandler:^(NSInteger errorCode, NSString *errorDescription) {
                 if (errorCode == 0) {
                 
-                    NSLog(@"[LOG] Unsubscribed to Push Notification server & proxy successfully.");
+                    [[NCCommunicationCommon shared] writeLog:@"[LOG] Unsubscribed to Push Notification server & proxy successfully."];
                     
                     [CCUtility setPushNotificationPublicKey:account data:nil];
                     [CCUtility setPushNotificationSubscribingPublicKey:account publicKey:nil];
@@ -982,7 +982,7 @@
         return;
     }
     
-    NSLog(@"[LOG] Start perform Fetch With Completion Handler");
+    [[NCCommunicationCommon shared] writeLog:@"[LOG] Start perform Fetch With Completion Handler"];
     
     // Verify new photo
     [[NCAutoUpload sharedInstance] initStateAutoUpload];
@@ -998,7 +998,7 @@
             completionHandler(UIBackgroundFetchResultNoData);
         }
         
-        NSLog(@"[LOG] End 20 sec. perform Fetch With Completion Handler");
+        [[NCCommunicationCommon shared] writeLog:@"[LOG] End 20 sec. perform Fetch With Completion Handler"];
     });
 }
 
@@ -1011,7 +1011,7 @@
 //
 - (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler
 {
-    NSLog(@"[LOG] Start handle Events For Background URLSession: %@", identifier);
+    [[NCCommunicationCommon shared] writeLog:[NSString stringWithFormat:@"[LOG] Start handle Events For Background URLSession: %@", identifier]];
     
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 20 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
         self.backgroundSessionCompletionHandler = completionHandler;

+ 6 - 7
iOSClient/AutoUpload/NCAutoUpload.m

@@ -137,13 +137,13 @@
     
     if ([CLLocationManager locationServicesEnabled]) {
         
-        NSLog(@"[LOG] checkIfLocationIsEnabled : authorizationStatus: %d", [CLLocationManager authorizationStatus]);
+        [[NCCommunicationCommon shared] writeLog:[NSString stringWithFormat:@"[LOG] checkIfLocationIsEnabled : authorizationStatus: %d", [CLLocationManager authorizationStatus]]];
         
         if ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorizedAlways) {
             
             if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined ) {
                 
-                NSLog(@"[LOG] checkIfLocationIsEnabled : Location services not determined");
+                [[NCCommunicationCommon shared] writeLog:@"[LOG] checkIfLocationIsEnabled : Location services not determined"];
                 [[CCManageLocation sharedInstance] startSignificantChangeUpdates];
                 
             } else {
@@ -295,8 +295,7 @@
             //check location
             if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedAlways) {
                 
-                NSLog(@"[LOG] Changed Location call uploadNewAssets");
-                
+                [[NCCommunicationCommon shared] writeLog:@"[LOG] Changed Location call uploadNewAssets"];
                 [self uploadNewAssets];
             }
             
@@ -352,12 +351,12 @@
     // News Assets ? if no verify if blocked Table Auto Upload -> Autostart
     if (newAssetToUpload == nil || [newAssetToUpload count] == 0) {
         
-        NSLog(@"[LOG] Auto upload, no new asset found");
+        [[NCCommunicationCommon shared] writeLog:@"[LOG] Auto upload, no new asset found"];
         return;
         
     } else {
         
-        NSLog(@"[LOG] Auto upload, new %lu asset found", (unsigned long)[newAssetToUpload count]);
+        [[NCCommunicationCommon shared] writeLog:[NSString stringWithFormat:@"[LOG] Auto upload, new %lu asset found", (unsigned long)[newAssetToUpload count]]];
     }
     
     dispatch_async(dispatch_get_main_queue(), ^{
@@ -587,7 +586,7 @@
     if (assets != nil) {
         (void)[[NCManageDatabase sharedInstance] addPhotoLibrary:(NSArray *)assets account:account.account];
 
-        NSLog(@"[LOG] Align Photo Library %lu", (unsigned long)[assets count]);
+        [[NCCommunicationCommon shared] writeLog:[NSString stringWithFormat:@"[LOG] Align Photo Library %lu", (unsigned long)[assets count]]];
     }
 }
 

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -407,7 +407,7 @@
         }
         [[NCAutoUpload sharedInstance] initStateAutoUpload];
         
-        NSLog(@"[LOG] Request Service Server Nextcloud");
+        [[NCCommunicationCommon shared] writeLog:@"[LOG] Request Service Server Nextcloud"];
         [[NCService shared] startRequestServicesServer];
                 
         // Read this folder

+ 0 - 2
iOSClient/ManageLocation+ManageAsset/CCManageLocation.m

@@ -22,12 +22,10 @@
 //
 
 #import "CCManageLocation.h"
-
 #import "AppDelegate.h"
 
 @implementation CCManageLocation
 
-
 + (CCManageLocation *)sharedInstance
 {
     static CCManageLocation *sharedInstance;

+ 1 - 1
iOSClient/Settings/CCAdvanced.m

@@ -291,7 +291,7 @@
         
         NSInteger logLevel = [[rowDescriptor.value valueData] intValue];
         [CCUtility setLogLevel:logLevel];
-        [[NCCommunicationCommon shared] setFileLogWithLevel:logLevel];
+        [[NCCommunicationCommon shared] setFileLogWithLevel:logLevel echo:true];
     }
 }