SFSafariViewControllerDelegate not being called for redirects

This method does not seem to work consistently: SFSafariViewControllerDelegate.safariViewController(_ controller: SFSafariViewController, initialLoadDidRedirectTo URL: URL)

It was working 100% of the time until this week for me, now it has about a 1-5% success rate for detecting redirects.

The docs are not clear:

 @discussion This method may be called even after -safariViewController:didCompleteInitialLoad: if
    the web page performs additional redirects without user interaction.

Code snippet from calling UIViewController that conforms to SFSafariViewControllerDelegate:

            let config = SafariViewController.Configuration()
            config.entersReaderIfAvailable = false
            let vc = SFSafariViewController(url: url, configuration: config)
            vc.delegate = self
            self.safariViewController = vc
            print(self.safariViewController?.delegate)
            self.present(vc, animated: true)

Did something change? How can I make this consistent again?

Answered by Engineer in 789593022

This may be a duplicate of the question I answered here.

Accepted Answer

This may be a duplicate of the question I answered here.

SFSafariViewControllerDelegate not being called for redirects
 
 
Q