I am integrating fitbit login-api in iOS with Objective C and I need to get the callback URL.
I am currently using SFSafariViewController
but I cannot read the URL after login. Is it possible to get the URL from SFSafariViewController
?
SFSafariViewController no longer shares cookies with the standalone Safari browser. Thus, a website can no longer determine that the user on SFSafariViewController is the same user on Safari, even though the view controller and the browser are open on the same device.
You can think of WKWebView as a stripped-down version of Safari. It is responsible to load a URL request and display the web content. WKWebView has the benefit of the Nitro JavaScript engine and offers more features. If you just need to display a specific web page, WKWebView is the best option for this scenario.
An object that provides a visible standard interface for browsing the web. iOS 9.0+ iPadOS 9.0+ Mac Catalyst 13.1+
In SFSafariViewControllerDelegate
you have only one method, that can help:
optional public func safariViewController(controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool)
But it will be called only on initial (first) url loaded. If you have redirects and wait for some url in auth process - it will not help.
Then you should use UIWebView
and implement UIWebViewDelegate
delegate method:
optional public func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool
But don't remember to be ATS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With