diff --git a/FirebaseStaticInjections/FirebaseStaticInjections/_Tracking/FirebaseTracking.swift b/FirebaseStaticInjections/FirebaseStaticInjections/_Tracking/FirebaseTracking.swift index 3b3bbb1fa..220133d5c 100644 --- a/FirebaseStaticInjections/FirebaseStaticInjections/_Tracking/FirebaseTracking.swift +++ b/FirebaseStaticInjections/FirebaseStaticInjections/_Tracking/FirebaseTracking.swift @@ -24,7 +24,7 @@ public class FirebaseTracking: TransformerTracker { override public init() { super.init() - FirebaseConfiguration.shared.setLoggerLevel(.max) + FirebaseConfiguration.shared.setLoggerLevel(.min) Analytics.setUserProperty(String(format: "%.4f", UIDevice.current.systemVersionAsFloat), forName: "os_version") } diff --git a/PlatformParticles/PlatformParticles/_ViewController/TrackingViewController.swift b/PlatformParticles/PlatformParticles/_ViewController/TrackingViewController.swift index b0a38dd0a..2fddb2a58 100644 --- a/PlatformParticles/PlatformParticles/_ViewController/TrackingViewController.swift +++ b/PlatformParticles/PlatformParticles/_ViewController/TrackingViewController.swift @@ -19,6 +19,11 @@ open class TrackingViewController: NavigableViewController { navigationController?.navigationBar.setNeedsLayout() } } + + override open func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + Tracking.shared?.leave(history?.path) + } override open func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) diff --git a/dydx/dydx.xcworkspace/xcshareddata/swiftpm/Package.resolved b/dydx/dydx.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7d9595b53..44030d6e4 100644 --- a/dydx/dydx.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/dydx/dydx.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "975d00e29efb8d2ca017c5e61df90418ac01f7d7143e85a3f9ddb4eb982154e4", + "originHash" : "1c0055be4aba3ed4d97a2f62f05486877839310f65e2cbdd18b067bef06a04a3", "pins" : [ { "identity" : "bigint", @@ -46,15 +46,6 @@ "revision" : "48134b5460435cc9d048223ad7560ee2e40f3d4a" } }, - { - "identity" : "percy-xcui-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/percy/percy-xcui-swift", - "state" : { - "revision" : "a2e9a86dfc3f5b69ef53cbda28a0ea71098c9f77", - "version" : "1.0.0" - } - }, { "identity" : "qrcode", "kind" : "remoteSourceControl", diff --git a/dydx/dydxAnalytics/dydxAnalytics/AnalyticsEvent.swift b/dydx/dydxAnalytics/dydxAnalytics/AnalyticsEvent.swift index 38c922ab3..a24e72117 100644 --- a/dydx/dydxAnalytics/dydxAnalytics/AnalyticsEvent.swift +++ b/dydx/dydxAnalytics/dydxAnalytics/AnalyticsEvent.swift @@ -13,6 +13,7 @@ import FirebaseAnalytics // // Events defined in the v4-web repo. Ideally, we should keep this in-sync with v4-web // +// TODO: deprecate and replace with AnalyticsEventV2 public enum AnalyticsEvent: String { // App case networkStatus = "NetworkStatus" @@ -67,6 +68,7 @@ public extension AnalyticsEventV2 { } public enum AnalyticsEventV2: TrackableEvent, CustomDebugStringConvertible { + // TODO: add and replace all events case appStart case navigatePage(screen: ScreenIdentifiable) case deepLinkHandled(url: String, succeeded: Bool) diff --git a/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift b/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift index 51c452c22..47f88e996 100644 --- a/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift +++ b/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift @@ -14,7 +14,6 @@ import PlatformUI import Combine import dydxStateManager import Abacus -import dydxAnalytics public class dydxMarketInfoViewBuilder: NSObject, ObjectBuilderProtocol { public func build() -> T? { @@ -27,12 +26,9 @@ public class dydxMarketInfoViewBuilder: NSObject, ObjectBuilderProtocol { } private class dydxMarketInfoViewController: HostingViewController { - private var selectedMarketId: String { - history?.params?["market"] as? String ?? dydxSelectedMarketsStore.shared.lastSelectedMarket - } - override public func arrive(to request: RoutingRequest?, animated: Bool) -> Bool { if request?.path == "/trade" || request?.path == "/market", let presenter = presenter as? dydxMarketInfoViewPresenter { + let selectedMarketId = request?.params?["market"] as? String ?? dydxSelectedMarketsStore.shared.lastSelectedMarket dydxSelectedMarketsStore.shared.lastSelectedMarket = selectedMarketId presenter.marketId = selectedMarketId if let sectionRaw = request?.params?["currentSection"] as? String { diff --git a/dydx/dydxPresenters/dydxPresenters/_v4/Markets/dydxMarketsViewBuilder.swift b/dydx/dydxPresenters/dydxPresenters/_v4/Markets/dydxMarketsViewBuilder.swift index dbcdbcac5..b0677bd27 100644 --- a/dydx/dydxPresenters/dydxPresenters/_v4/Markets/dydxMarketsViewBuilder.swift +++ b/dydx/dydxPresenters/dydxPresenters/_v4/Markets/dydxMarketsViewBuilder.swift @@ -16,7 +16,6 @@ import dydxStateManager import Combine import Charts import dydxFormatter -import dydxAnalytics public class dydxMarketsViewBuilder: NSObject, ObjectBuilderProtocol { public func build() -> T? { @@ -30,7 +29,7 @@ public class dydxMarketsViewBuilder: NSObject, ObjectBuilderProtocol { private class dydxMarketsViewController: HostingViewController { override public func arrive(to request: RoutingRequest?, animated: Bool) -> Bool { - request?.path == "/markets" + request?.path == "/portfolio/overview" || request?.path == "/markets" } } diff --git a/dydx/dydxPresenters/dydxPresenters/_v4/TakeProfitStopLoss/dydxTakeProfitStopLossViewPresenter.swift b/dydx/dydxPresenters/dydxPresenters/_v4/TakeProfitStopLoss/dydxTakeProfitStopLossViewPresenter.swift index 03088df37..5fad85059 100644 --- a/dydx/dydxPresenters/dydxPresenters/_v4/TakeProfitStopLoss/dydxTakeProfitStopLossViewPresenter.swift +++ b/dydx/dydxPresenters/dydxPresenters/_v4/TakeProfitStopLoss/dydxTakeProfitStopLossViewPresenter.swift @@ -17,7 +17,6 @@ import PanModal import Combine import Abacus import dydxFormatter -import dydxAnalytics public class dydxTakeProfitStopLossViewBuilder: NSObject, ObjectBuilderProtocol { public func build() -> T? { @@ -43,7 +42,6 @@ private protocol dydxTakeProfitStopLossViewPresenterProtocol: HostedViewPresente } private class dydxTakeProfitStopLossViewPresenter: HostedViewPresenter, dydxTakeProfitStopLossViewPresenterProtocol { - fileprivate var marketId: String? @SynchronizedLock private var pendingOrders: Int? diff --git a/dydx/dydxViews/dydxViews/SwiftUIHosting/HostingViewController.swift b/dydx/dydxViews/dydxViews/SwiftUIHosting/HostingViewController.swift index 6e6475d98..1a6c32622 100644 --- a/dydx/dydxViews/dydxViews/SwiftUIHosting/HostingViewController.swift +++ b/dydx/dydxViews/dydxViews/SwiftUIHosting/HostingViewController.swift @@ -16,7 +16,6 @@ import UIToolkits import PlatformRouting import FloatingPanel import Utilities -import dydxAnalytics public struct HostingViewControllerConfiguration { public init(ignoreSafeArea: Bool = true, fixedHeight: CGFloat? = nil, gradientTabbar: Bool = false, disableNavigationController: Bool = false) { diff --git a/dydxV4/dydxV4/_Configurations/dydxevents.json b/dydxV4/dydxV4/_Configurations/dydxevents.json index f934d0a36..0c6a6de89 100644 --- a/dydxV4/dydxV4/_Configurations/dydxevents.json +++ b/dydxV4/dydxV4/_Configurations/dydxevents.json @@ -50,6 +50,13 @@ "modalType":"EMAIL_NOTIFICATIONS" } }, + "/markets":{ + "event":"NavigatePage", + "info":{ + "path":"/portfolio/overview", + "isInitialNavigatePage":false + } + }, "/my-profile":{ "event":"NavigatePage", "info":{