mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
feat(analytics): disable analytics unless credentials are configured
Removes the onboarding opt-in screen, the Analytics settings entry and the unused Posthog and Sentry SDKs.
This commit is contained in:
@@ -16,7 +16,12 @@ object ModulesConfig {
|
|||||||
includeUnifiedPush = BuildTimeConfig.PUSH_CONFIG_INCLUDE_UNIFIED_PUSH,
|
includeUnifiedPush = BuildTimeConfig.PUSH_CONFIG_INCLUDE_UNIFIED_PUSH,
|
||||||
)
|
)
|
||||||
|
|
||||||
val analyticsConfig: AnalyticsConfig = if (isEnterpriseBuild) {
|
// Analytics is enabled only when credentials are actually configured in BuildTimeConfig.
|
||||||
|
// Upstream applies this rule to enterprise builds only and hardcodes both providers on for
|
||||||
|
// FOSS builds; HealthChat ships no Posthog or Sentry credentials, so that hardcoding meant
|
||||||
|
// shipping both SDKs, prompting every new user with the analytics opt-in screen during the
|
||||||
|
// FTUE, and showing an Analytics settings entry — all while collecting nothing.
|
||||||
|
val analyticsConfig: AnalyticsConfig = run {
|
||||||
// Is Posthog configuration available?
|
// Is Posthog configuration available?
|
||||||
val withPosthog = BuildTimeConfig.SERVICES_POSTHOG_APIKEY.isNullOrEmpty().not() &&
|
val withPosthog = BuildTimeConfig.SERVICES_POSTHOG_APIKEY.isNullOrEmpty().not() &&
|
||||||
BuildTimeConfig.SERVICES_POSTHOG_HOST.isNullOrEmpty().not()
|
BuildTimeConfig.SERVICES_POSTHOG_HOST.isNullOrEmpty().not()
|
||||||
@@ -32,11 +37,5 @@ object ModulesConfig {
|
|||||||
println("Analytics disabled")
|
println("Analytics disabled")
|
||||||
AnalyticsConfig.Disabled
|
AnalyticsConfig.Disabled
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
println("Analytics enabled with Posthog and Sentry")
|
|
||||||
AnalyticsConfig.Enabled(
|
|
||||||
withPosthog = true,
|
|
||||||
withSentry = true,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user