Search code examples
iosobjective-cwebkitios9

Is there a way to set the referer in the initial request made by SFSafariViewController?


SFSafariViewController is compelling, but has a very simple API that doesn't allow setting any fields on the request it initiates when presented. Are there any clever ways to set the HTTP referer header on requests initiated from SFSafariViewController?


Solution

  • There is no API for that, unfortunately.

    You can check SFSafariViewControllerDelegate page - all of the delegate methods is post-load handlers.

    WKWebView and WKNavigationDelegate is one of possible replacements (iOS 8.0+).