@@ -194,6 +194,35 @@ import WordPressKit
194194 showGetStarted ( from: presenter, jetpackLogin: jetpackLogin, connectedEmail: connectedEmail, siteURL: siteURL)
195195 }
196196
197+ /// Used to present the Verify Email flow from the app delegate.
198+ ///
199+ /// - Parameters:
200+ /// - presenter: The view controller that presents the Verify Email view.
201+ /// - xmlrpc: The URL to reach the XMLRPC file of the site to log in to.
202+ /// - connectedEmail: The email address used to authorized Jetpack connection with the site.
203+ /// - siteURL: The URL of the site to log in to.
204+ ///
205+ @objc public class func showVerifyEmailForWPCom( from presenter: UIViewController , xmlrpc: String , connectedEmail: String , siteURL: String ) {
206+ guard let xmlrpcURL = URL ( string: xmlrpc) else {
207+ DDLogError ( " Failed to initiate XML-RPC URL from \( xmlrpc) " )
208+ return
209+ }
210+ let loginFields = LoginFields ( )
211+ loginFields. meta. xmlrpcURL = xmlrpcURL as NSURL
212+ loginFields. username = connectedEmail
213+ loginFields. siteAddress = siteURL
214+
215+ guard let vc = VerifyEmailViewController . instantiate ( from: . verifyEmail) else {
216+ DDLogError ( " Failed to navigate to VerifyEmailViewController " )
217+ return
218+ }
219+
220+ vc. loginFields = loginFields
221+ let navController = LoginNavigationController ( rootViewController: vc)
222+ navController. modalPresentationStyle = . fullScreen
223+ presenter. present ( navController, animated: true , completion: nil )
224+ }
225+
197226 /// Shows the unified Login/Signup flow.
198227 ///
199228 private class func showGetStarted( from presenter: UIViewController , jetpackLogin: Bool , connectedEmail: String ? = nil , siteURL: String ? = nil ) {
0 commit comments