Feature/3608 matomo new

This commit is contained in:
Frank Rotermund
2022-09-21 08:54:22 +00:00
parent 087b4e1715
commit c20a0a7bdb
17 changed files with 310 additions and 52 deletions
+23 -13
View File
@@ -178,15 +178,7 @@
{
MXLogDebug(@"[MasterTabBarController] viewDidAppear");
[super viewDidAppear:animated];
if (BuildSettings.bwiShowMatomoInfoScreen) {
NSString *matomoInfoScreenShownKey = @"bwi_matomo_info_screen_shown";
if (![[NSUserDefaults standardUserDefaults] boolForKey: matomoInfoScreenShownKey]) {
[[NSUserDefaults standardUserDefaults] setBool:TRUE forKey: matomoInfoScreenShownKey];
[self bwiShowMatomoInfoScreen];
}
}
/**
* Display the splash screen only one time although
* the viewDidAppear is invoked multiple time in the
@@ -1104,6 +1096,10 @@
default:
break;
}
if ([BWIAnalytics.sharedTracker needsToShowPromt]) {
[self bwiShowMatomoInfoScreen];
}
}
- (void) bwiCheckForPersonalNotesRoom {
@@ -1135,11 +1131,25 @@
#pragma mark - bwi matomo tracking
- (void) bwiShowMatomoInfoScreen {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil
message:BWIL10n.matomoUserInfo
UIAlertController *alert = [UIAlertController alertControllerWithTitle:BWIL10n.bwiAnalyticsAlertTitle
message:[BWIL10n bwiAnalyticsAlertBody:AppInfo.current.displayName]
preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok] style:UIAlertActionStyleDefault handler:nil]];
[self presentViewController:alert animated:YES completion:nil];
[alert addAction:[UIAlertAction actionWithTitle:BWIL10n.bwiAnalyticsAlertInfoButton style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
WebViewViewController *webViewViewController = [[WebViewViewController alloc] initWithURL:BuildSettings.applicationPrivacyPolicyUrlString];
webViewViewController.title = [VectorL10n settingsPrivacyPolicy];
[self.navigationController pushViewController:webViewViewController animated:YES];
}]];
[alert addAction:[UIAlertAction actionWithTitle:BWIL10n.bwiAnalyticsAlertCancelButton style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
BWIAnalytics.sharedTracker.running = NO;
}]];
[alert addAction:[UIAlertAction actionWithTitle:BWIL10n.bwiAnalyticsAlertOkButton style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) {
BWIAnalytics.sharedTracker.running = YES;
}]];
[self presentViewController:alert animated:YES completion:^() {
[BWIAnalytics.sharedTracker setPromtShown:YES];
}];
}
@end