marinofaggiana 5 years ago
parent
commit
d412a41602
3 changed files with 16 additions and 12 deletions
  1. 1 1
      iOSClient/AppDelegate.m
  2. 1 0
      iOSClient/Brand/NCBrand.swift
  3. 14 11
      iOSClient/Settings/CCAdvanced.m

+ 1 - 1
iOSClient/AppDelegate.m

@@ -146,7 +146,7 @@ PKPushRegistry *pushRegistry;
     [self startTimerErrorNetworking];
 
     // Fabric
-    if (![CCUtility getDisableCrashservice]) {
+    if (![CCUtility getDisableCrashservice] && NCBrandOptions.sharedInstance.disable_crash_service == false) {
         [Fabric with:@[[Crashlytics class]]];
     }
     

+ 1 - 0
iOSClient/Brand/NCBrand.swift

@@ -87,6 +87,7 @@ import UIKit
     @objc public var disable_manage_account:            Bool = false
     @objc public var disable_more_external_site:        Bool = false
     @objc public var disable_openin_file:               Bool = false                                                // Don't touch me !!
+    @objc public var disable_crash_service:             Bool = false
     
     override init() {
         

+ 14 - 11
iOSClient/Settings/CCAdvanced.m

@@ -102,18 +102,21 @@
     
     // Section : Privacy --------------------------------------------------------------
 
-    section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_privacy_", nil)];
-    [form addFormSection:section];
-    section.footerTitle = NSLocalizedString(@"_privacy_footer_", nil);
+    if (!NCBrandOptions.sharedInstance.disable_crash_service) {
     
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"crashservice" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_crashservice_title_", nil)];
-    row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.sharedInstance.backgroundView;
-    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
-    [row.cellConfig setObject:NCBrandColor.sharedInstance.textView forKey:@"textLabel.textColor"];
-    [row.cellConfig setObject:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"crashservice"] width:50 height:50 color:NCBrandColor.sharedInstance.icon] forKey:@"imageView.image"];
-    if ([CCUtility getDisableCrashservice]) row.value = @"1";
-    else row.value = @"0";
-    [section addFormRow:row];
+        section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_privacy_", nil)];
+        [form addFormSection:section];
+        section.footerTitle = NSLocalizedString(@"_privacy_footer_", nil);
+        
+        row = [XLFormRowDescriptor formRowDescriptorWithTag:@"crashservice" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_crashservice_title_", nil)];
+        row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.sharedInstance.backgroundView;
+        [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
+        [row.cellConfig setObject:NCBrandColor.sharedInstance.textView forKey:@"textLabel.textColor"];
+        [row.cellConfig setObject:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"crashservice"] width:50 height:50 color:NCBrandColor.sharedInstance.icon] forKey:@"imageView.image"];
+        if ([CCUtility getDisableCrashservice]) row.value = @"1";
+        else row.value = @"0";
+        [section addFormRow:row];
+    }
     
     // Section CLEAR CACHE -------------------------------------------------