From 78d6807ea3e9467f661e85e7b61538545f82e890 Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Thu, 1 Jul 2021 13:33:39 +0800 Subject: [PATCH] Log analytics: user's Dynamic Type setting --- AlphaWallet/Analytics/Models/AnalyticsTypes.swift | 1 + AlphaWallet/InCoordinator.swift | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/AlphaWallet/Analytics/Models/AnalyticsTypes.swift b/AlphaWallet/Analytics/Models/AnalyticsTypes.swift index 245bb3894..08d3e7f9f 100644 --- a/AlphaWallet/Analytics/Models/AnalyticsTypes.swift +++ b/AlphaWallet/Analytics/Models/AnalyticsTypes.swift @@ -83,6 +83,7 @@ enum Analytics { case hdWalletsCount case keystoreWalletsCount case watchedWalletsCount + case dynamicTypeSetting } enum ScanQRCodeSource: String { diff --git a/AlphaWallet/InCoordinator.swift b/AlphaWallet/InCoordinator.swift index 9bec44ad6..c02620d59 100644 --- a/AlphaWallet/InCoordinator.swift +++ b/AlphaWallet/InCoordinator.swift @@ -437,6 +437,7 @@ class InCoordinator: NSObject, Coordinator { logEnabledChains() logWallets() + logDynamicTypeSetting() } private func createTokensCoordinator(promptBackupCoordinator: PromptBackupCoordinator) -> TokensCoordinator { @@ -1151,6 +1152,11 @@ extension InCoordinator { analyticsCoordinator.setUser(property: Analytics.UserProperties.watchedWalletsCount, value: watchedWalletsCount) } + private func logDynamicTypeSetting() { + let setting = UIApplication.shared.preferredContentSizeCategory.rawValue + analyticsCoordinator.setUser(property: Analytics.UserProperties.dynamicTypeSetting, value: setting) + } + private func logTappedSwap(service: SwapTokenURLProviderType) { analyticsCoordinator.log(navigation: Analytics.Navigation.tokenSwap, properties: [Analytics.Properties.name.rawValue: service.analyticsName]) }