-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
analyticsv2 PoC #169
analyticsv2 PoC #169
Changes from all commits
3e1b199
1a7966c
0c62862
dad49a5
48fecd2
c89ee2d
afd52e5
d722c9b
1541e31
bb93b08
33cdd69
6bb5c99
fd4206b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,31 +11,25 @@ import PlatformRouting | |
import UIToolkits | ||
import Utilities | ||
|
||
open class TrackingViewController: NavigableViewController, TrackingViewProtocol { | ||
public var trackingData: TrackingData? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tracking data moved into |
||
open class TrackingViewController: NavigableViewController { | ||
|
||
override open func viewWillAppear(_ animated: Bool) { | ||
super.viewWillAppear(animated) | ||
if #available(iOS 13.0, *) { | ||
navigationController?.navigationBar.setNeedsLayout() | ||
} | ||
} | ||
|
||
override open func viewDidAppear(_ animated: Bool) { | ||
super.viewDidAppear(animated) | ||
|
||
logView(path: history?.path, data: history?.params, from: nil, time: nil) | ||
} | ||
|
||
|
||
override open func viewWillDisappear(_ animated: Bool) { | ||
super.viewWillDisappear(animated) | ||
Tracking.shared?.leave(trackingData?.path) | ||
trackingData = nil | ||
Tracking.shared?.leave(history?.path) | ||
} | ||
|
||
open func logView(path: String?, data: [String: Any]?, from: String?, time: Date?) { | ||
if let path = path, trackingData?.path != path { | ||
trackingData = TrackingData(path: path, data: data) | ||
Tracking.shared?.view(path, data: data, from: from, time: time, revenue: nil, contextViewController: self) | ||
override open func viewDidAppear(_ animated: Bool) { | ||
super.viewDidAppear(animated) | ||
|
||
if let self = self as? TrackingViewProtocol { | ||
self.logScreenView() | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -451,9 +451,6 @@ open class MappedUIKitRouter: MappedRouter { | |
self?.actions.removeAll(where: { (actionInList) -> Bool in | ||
actionReference === actionInList | ||
}) | ||
if success, request.path?.hasPrefix("/action") ?? false { | ||
Tracking.shared?.view(request.path, data: request.params, from: nil, time: nil) | ||
} | ||
Comment on lines
-454
to
-456
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actions should not be view events, should be dedicated action events. Did not make scope for this PR |
||
completion?(data, success) | ||
} | ||
} else { | ||
|
@@ -471,14 +468,6 @@ open class MappedUIKitRouter: MappedRouter { | |
completion(nil) | ||
} | ||
} | ||
|
||
override open func previousTracking() -> TrackingData? { | ||
if let vc = UIViewController.topmost() as? TrackingViewProtocol { | ||
return vc.trackingData | ||
} else { | ||
return nil | ||
} | ||
} | ||
Comment on lines
-475
to
-481
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TrackingData was removed in this PR, functionality was replaced |
||
|
||
private func loadViewController(from map: RoutingMap, completion: @escaping ((UIViewController?) -> Void)) { | ||
if let builder = map.builder { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -271,10 +271,6 @@ open class MappedRouter: NSObject, RouterProtocol, ParsingProtocol, CombineObser | |
} | ||
} | ||
|
||
open func previousTracking() -> TrackingData? { | ||
return nil | ||
} | ||
|
||
open func reallyNavigate(to request: RoutingRequest, presentation: RoutingPresentation?, animated: Bool, completion: RoutingCompletionBlock?) { | ||
if let path = request.path { | ||
Console.shared.log("Route to \(path)") | ||
|
@@ -284,20 +280,13 @@ open class MappedRouter: NSObject, RouterProtocol, ParsingProtocol, CombineObser | |
} else { | ||
let transformed = transform(request: request) | ||
if let map = self.map(for: transformed) { | ||
let previousTracking = previousTracking() | ||
backtrack(request: transformed, animated: animated) { [weak self] data, completed in | ||
if completed { | ||
if let viewController = data as? TrackingViewProtocol { | ||
viewController.logView(path: transformed.path, data: nil, from: previousTracking?.path, time: previousTracking?.startTime) | ||
} | ||
completion?(nil, true) | ||
} else { | ||
self?.route(dependencies: map, request: transformed, completion: { [weak self] _, successful in | ||
if successful { | ||
self?.navigate(to: map, request: transformed, presentation: presentation ?? transformed.presentation, animated: animated, completion: { /* [weak self] */ data, successful in | ||
if successful, let viewController = data as? TrackingViewProtocol { | ||
viewController.logView(path: transformed.path, data: nil, from: previousTracking?.path, time: previousTracking?.startTime) | ||
} | ||
Comment on lines
-290
to
-300
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we were logging a view event both here and in the |
||
completion?(data, successful) | ||
}) | ||
} else { | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all
view
functions were removed in favor ofnavigatePage
analytics v2 event