Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 6130b0f

Browse files
Merge pull request #673 from wordpress-mobile/wcios/pass-flow-and-step-via-delegate
Pass `Flow` and `Step` via `WordPressAuthenticatorDelegate`
2 parents 610a05e + 5ea0d99 commit 6130b0f

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |s|
44
s.name = 'WordPressAuthenticator'
5-
s.version = '2.3.0'
5+
s.version = '2.4.0-beta.1'
66

77
s.summary = 'WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps.'
88
s.description = <<-DESC

WordPressAuthenticator/Authenticator/WordPressAuthenticatorDelegateProtocol.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,15 @@ public protocol WordPressAuthenticatorDelegate: AnyObject {
6060
///
6161
func presentSignupEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials, service: SocialService?)
6262

63-
/// Presents the Support Interface from a given ViewController, with a specified SourceTag.
63+
/// Presents the Support Interface from a given ViewController.
6464
///
65-
func presentSupport(from sourceViewController: UIViewController, sourceTag: WordPressSupportSourceTag)
65+
/// - Parameters:
66+
/// - from: ViewController from which to present the support interface from
67+
/// - sourceTag: Support source tag of the view controller.
68+
/// - lastStep: Last `Step` tracked in `AuthenticatorAnalyticsTracker`
69+
/// - lastFlow: Last `Flow` tracked in `AuthenticatorAnalyticsTracker`
70+
///
71+
func presentSupport(from sourceViewController: UIViewController, sourceTag: WordPressSupportSourceTag, lastStep: AuthenticatorAnalyticsTracker.Step, lastFlow: AuthenticatorAnalyticsTracker.Flow)
6672

6773
/// Indicates if the Login Epilogue should be displayed.
6874
///

WordPressAuthenticator/Extensions/FancyAlertViewController+LoginError.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ extension FancyAlertViewController {
121121
return
122122
}
123123

124-
authDelegate.presentSupport(from: sourceViewController, sourceTag: sourceTag)
124+
let state = AuthenticatorAnalyticsTracker.shared.state
125+
authDelegate.presentSupport(from: sourceViewController, sourceTag: sourceTag, lastStep: state.lastStep, lastFlow: state.lastFlow)
125126
}
126127
}
127128

WordPressAuthenticator/NUX/NUXViewControllerBase.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ extension NUXViewControllerBase where Self: UIViewController, Self: UIViewContro
319319
fatalError()
320320
}
321321

322-
WordPressAuthenticator.shared.delegate?.presentSupport(from: navigationController, sourceTag: source)
322+
let state = AuthenticatorAnalyticsTracker.shared.state
323+
WordPressAuthenticator.shared.delegate?.presentSupport(from: navigationController, sourceTag: source, lastStep: state.lastStep, lastFlow: state.lastFlow)
323324
}
324325
}

0 commit comments

Comments
 (0)