dvfend
dvfend

Reputation: 51

specify SFSafariViewController user agent

I have an issue specifying access from SFSafariViewController since it has the exact same user agent as Safari browser.

What i'm trying to do is display a picture only inside the webview and remove it if its viewed on normal browser.

Tried to see if document.refferer can be used and I tried it on twitter since the latest update has its webview changed to SFSafariViewController. Almost worked but the referrer info is also being passed to safari if its opened directly from SFSafariViewController.

Would really appreciate any ideas... thanks!!

Upvotes: 5

Views: 2617

Answers (1)

Leo
Leo

Reputation: 302

I did a bit of quick research on this, and it appears that this is not possible, hence the word Safari in SFSafariViewController.

However you can do this using the WebKit WKWebView: https://developer.apple.com/documentation/webkit/wkwebview/1414950-customuseragent

Upvotes: 0

Related Questions