From 9d6d30d3cec8bdf86a9d32ce2bd6158db9e4a386 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Wed, 20 Nov 2024 10:10:44 +0100 Subject: [PATCH] feat: enable countly crash reporting [WPB-12186] (#3641) --- .../AnonymousAnalyticsRecorderImpl.kt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/core/analytics-enabled/src/main/kotlin/com/wire/android/feature/analytics/AnonymousAnalyticsRecorderImpl.kt b/core/analytics-enabled/src/main/kotlin/com/wire/android/feature/analytics/AnonymousAnalyticsRecorderImpl.kt index 78ef8edb4e4..46e9d2ce23e 100644 --- a/core/analytics-enabled/src/main/kotlin/com/wire/android/feature/analytics/AnonymousAnalyticsRecorderImpl.kt +++ b/core/analytics-enabled/src/main/kotlin/com/wire/android/feature/analytics/AnonymousAnalyticsRecorderImpl.kt @@ -40,12 +40,18 @@ class AnonymousAnalyticsRecorderImpl : AnonymousAnalyticsRecorder { context, analyticsSettings.countlyAppKey, analyticsSettings.countlyServerUrl - ) - .enableTemporaryDeviceIdMode() // Nothing is sent until a proper ID is placed - .setLoggingEnabled(analyticsSettings.enableDebugLogging) - countlyConfig.apm.enableAppStartTimeTracking() - countlyConfig.apm.enableForegroundBackgroundTracking() - countlyConfig.setApplication(context.applicationContext as Application) + ).apply { + setApplication(context.applicationContext as Application) + enableTemporaryDeviceIdMode() // Nothing is sent until a proper ID is placed + setLoggingEnabled(analyticsSettings.enableDebugLogging) + crashes.apply { + enableCrashReporting() + } + apm.apply { + enableAppStartTimeTracking() + enableForegroundBackgroundTracking() + } + } Countly.sharedInstance().init(countlyConfig) Countly.sharedInstance().consent().giveConsent(arrayOf("apm"))