ios – Passwordless single signal on utilizing SFSafariViewController in swift


I combine with safriService (SFSafariViewController) to log in by means of a single sign-on password, the issue was the primary time I log in utilizing SFSafariViewController however the authentication observe not full the primary time so the safari browser nonetheless seem & cannot direct into my app after authentication observe to change into a hit,
one other habits is after I login once more the authentication observe work tremendous & get the token then directed into my app tremendous so the principle downside is the primary time I login SFSafariViewController doesn’t catch the person auth

   if let url = URL(string: "url") {
        let safariVC = SFSafariViewController(url: url)
        safariVC.delegate = self

        safariVC.dismissButtonStyle = .accomplished
        current(safariVC, animated: true, completion: nil)
    }
extension DouWebViewVC: SFSafariViewControllerDelegate {

func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) {
    if didLoadSuccessfully {
            print("didLoadSuccessfully")
            // Do one thing with the URL right here
    }
}

//initialLoadDidRedirectTo
func safariViewController(_ controller: SFSafariViewController, initialLoadDidRedirectTo requestUrl: URL) {
    let absoluteUrl = requestUrl.absoluteString
    print("requestUrl(requestUrl)")
}

func safariViewControllerDidFinish(_ controller: SFSafariViewController) {
    print("safariViewControllerDidFinish")
}

}

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles