mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Feature/3608 matomo new
This commit is contained in:
@@ -43,6 +43,7 @@ enum
|
||||
SECTION_KEYBACKUP,
|
||||
#endif
|
||||
SECTION_ADVANCED,
|
||||
SECTION_ANALYTICS,
|
||||
SECTION_COUNT
|
||||
};
|
||||
|
||||
@@ -70,6 +71,10 @@ enum {
|
||||
ADVANCED_COUNT
|
||||
};
|
||||
|
||||
enum {
|
||||
ANALYTICS_ENABLED
|
||||
};
|
||||
|
||||
|
||||
@interface SecurityViewController () <
|
||||
SettingsSecureBackupTableViewSectionDelegate,
|
||||
@@ -320,9 +325,17 @@ TableViewSectionsDelegate>
|
||||
}
|
||||
|
||||
[sections addObject:pinCodeSection];
|
||||
|
||||
// BWI: if tracking is enabled show switch to turn it on/off
|
||||
if ([BWIAnalytics.sharedTracker isEnabled]) {
|
||||
Section *analyticsSection = [Section sectionWithTag:SECTION_ANALYTICS];
|
||||
[analyticsSection addRowWithTag:ANALYTICS_ENABLED];
|
||||
analyticsSection.headerTitle = BWIL10n.bwiSettingsAnalyticsSectionHeader;
|
||||
[sections addObject:analyticsSection];
|
||||
}
|
||||
|
||||
// Crypto sessions section
|
||||
|
||||
|
||||
if (RiotSettings.shared.settingsSecurityScreenShowSessions)
|
||||
{
|
||||
Section *sessionsSection = [Section sectionWithTag:SECTION_CRYPTO_SESSIONS];
|
||||
@@ -1286,6 +1299,21 @@ TableViewSectionsDelegate>
|
||||
}
|
||||
}
|
||||
}
|
||||
// bwi: analytics
|
||||
else if (sectionTag == SECTION_ANALYTICS)
|
||||
{
|
||||
if (rowTag == ANALYTICS_ENABLED) {
|
||||
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
|
||||
|
||||
labelAndSwitchCell.mxkLabel.text = BWIL10n.matomoSettingsSendDiagnosticData;
|
||||
labelAndSwitchCell.mxkSwitch.on = BWIAnalytics.sharedTracker.running;
|
||||
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
|
||||
labelAndSwitchCell.mxkSwitch.enabled = YES;
|
||||
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(bwiToggleEnableMatomoTracking:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
cell = labelAndSwitchCell;
|
||||
}
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
@@ -1880,4 +1908,13 @@ TableViewSectionsDelegate>
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - bwi analytics
|
||||
|
||||
- (void)bwiToggleEnableMatomoTracking:(UISwitch *)sender
|
||||
{
|
||||
BOOL isOn = sender.on;
|
||||
|
||||
BWIAnalytics.sharedTracker.running = isOn;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user