Log chains enabled by user

pull/2572/head
Hwee-Boon Yar 4 years ago
parent 7bae6af6a4
commit 5d5c294104
  1. 5
      AlphaWallet/Analytics/Models/AnalyticsEventPropertyValue.swift
  2. 1
      AlphaWallet/Analytics/Models/AnalyticsTypes.swift
  3. 10
      AlphaWallet/InCoordinator.swift

@ -51,3 +51,8 @@ extension AlphaWallet.Address: AnalyticsEventPropertyValue {
return self.eip55String
}
}
extension Array: AnalyticsEventPropertyValue where Iterator.Element == Int {
var value: Any {
self
}
}

@ -42,6 +42,7 @@ enum Analytics {
enum UserProperties: String, AnalyticsUserProperty {
case transactionCount
case testnetTransactionCount
case enabledChains
}
enum ScanQRCodeSource: String {

@ -358,6 +358,8 @@ class InCoordinator: NSObject, Coordinator {
let inCoordinatorViewModel = InCoordinatorViewModel()
showTab(inCoordinatorViewModel.initialTab)
logEnabledChains()
}
private func createTokensCoordinator(promptBackupCoordinator: PromptBackupCoordinator) -> TokensCoordinator {
@ -975,3 +977,11 @@ extension InCoordinator: ClaimOrderCoordinatorDelegate {
removeCoordinator(coordinator)
}
}
//MARK: Analytics
extension InCoordinator {
private func logEnabledChains() {
let list = config.enabledServers.map(\.chainID).sorted()
analyticsCoordinator?.setUser(property: Analytics.UserProperties.enabledChains, value: list)
}
}
Loading…
Cancel
Save