Don't read analytics opt in status from account data.

Update PostHog to 1.4.3.

Add tests for prompt type.
This commit is contained in:
Doug
2021-11-19 10:00:24 +00:00
parent a984028479
commit e8d02c5458
10 changed files with 184 additions and 101 deletions
+4 -9
View File
@@ -197,14 +197,9 @@
if (!authIsShown)
{
// Check whether the user should be prompted to send analytics.
MXSession *mxSession = self.mxSessions.firstObject;
if (mxSession && [Analytics.shared shouldShowPseudonymousAnalyticsPromptFor:mxSession])
if (Analytics.shared.shouldShowAnalyticsPrompt)
{
// We don't need to prompt users who previously declined the old analytics.
if (!RiotSettings.shared.hasSeenAndDeclinedMatomoAnalytics)
{
[self promptUserBeforeUsingAnalytics];
}
[self promptUserBeforeUsingAnalytics];
}
[self refreshTabBarBadges];
@@ -943,7 +938,7 @@
NSString *title = [VectorL10n analyticsPromptTitle:AppInfo.current.displayName];
NSString *message;
if (RiotSettings.shared.hasAcceptedMatomoAnalytics)
if (Analytics.shared.promptShouldDisplayUpgradeMessage)
{
message = [VectorL10n analyticsPromptPosthogUpgrade:AppInfo.current.displayName];
}
@@ -959,7 +954,7 @@
handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
[Analytics.shared optOutWith:mxSession];
[Analytics.shared optOut];
self->currentAlert = nil;
}]];