diff --git a/WordPressAuthenticator.podspec b/WordPressAuthenticator.podspec index b2a425910..0bc8d948a 100644 --- a/WordPressAuthenticator.podspec +++ b/WordPressAuthenticator.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.name = 'WordPressAuthenticator' - s.version = '2.3.0' + s.version = '2.4.0-beta.1' s.summary = 'WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps.' s.description = <<-DESC diff --git a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorDelegateProtocol.swift b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorDelegateProtocol.swift index e9b4dbf0d..903625351 100644 --- a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorDelegateProtocol.swift +++ b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorDelegateProtocol.swift @@ -60,9 +60,15 @@ public protocol WordPressAuthenticatorDelegate: AnyObject { /// func presentSignupEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials, service: SocialService?) - /// Presents the Support Interface from a given ViewController, with a specified SourceTag. + /// Presents the Support Interface from a given ViewController. /// - func presentSupport(from sourceViewController: UIViewController, sourceTag: WordPressSupportSourceTag) + /// - Parameters: + /// - from: ViewController from which to present the support interface from + /// - sourceTag: Support source tag of the view controller. + /// - lastStep: Last `Step` tracked in `AuthenticatorAnalyticsTracker` + /// - lastFlow: Last `Flow` tracked in `AuthenticatorAnalyticsTracker` + /// + func presentSupport(from sourceViewController: UIViewController, sourceTag: WordPressSupportSourceTag, lastStep: AuthenticatorAnalyticsTracker.Step, lastFlow: AuthenticatorAnalyticsTracker.Flow) /// Indicates if the Login Epilogue should be displayed. /// diff --git a/WordPressAuthenticator/Extensions/FancyAlertViewController+LoginError.swift b/WordPressAuthenticator/Extensions/FancyAlertViewController+LoginError.swift index b80af63da..9943351ba 100644 --- a/WordPressAuthenticator/Extensions/FancyAlertViewController+LoginError.swift +++ b/WordPressAuthenticator/Extensions/FancyAlertViewController+LoginError.swift @@ -121,7 +121,8 @@ extension FancyAlertViewController { return } - authDelegate.presentSupport(from: sourceViewController, sourceTag: sourceTag) + let state = AuthenticatorAnalyticsTracker.shared.state + authDelegate.presentSupport(from: sourceViewController, sourceTag: sourceTag, lastStep: state.lastStep, lastFlow: state.lastFlow) } } diff --git a/WordPressAuthenticator/NUX/NUXViewControllerBase.swift b/WordPressAuthenticator/NUX/NUXViewControllerBase.swift index 5583a7ed8..7abed336e 100644 --- a/WordPressAuthenticator/NUX/NUXViewControllerBase.swift +++ b/WordPressAuthenticator/NUX/NUXViewControllerBase.swift @@ -319,6 +319,7 @@ extension NUXViewControllerBase where Self: UIViewController, Self: UIViewContro fatalError() } - WordPressAuthenticator.shared.delegate?.presentSupport(from: navigationController, sourceTag: source) + let state = AuthenticatorAnalyticsTracker.shared.state + WordPressAuthenticator.shared.delegate?.presentSupport(from: navigationController, sourceTag: source, lastStep: state.lastStep, lastFlow: state.lastFlow) } }