Adding few more details:
When I am inspecting the code got the below errors with the mobile app SFSafariViewCotroller and the required content is not loading, but it is working fine with mobile, desktop Safari browsers and not showing any errors. Refused to load {URL://_csrfRefresh=1} because it does not appear in the frame-ancestors directive of the Content Security Policy.
Sandbox access violation: Blocked a frame at {URL} from accessing a cross-origin frame. Ther being accessed is sandboxed and lacks the "allow-same-origin" flag
Here I am unable to attach the screenshot. So adding stackover link - https://stackoverflow.com/questions/67560540/ios-in-app-with-sfsafariviewcontroller-unable-to-load-another-host-in-iframe for reference
I am using the below code to load the URL in SFSafariViewControl
@IBAction func launchSafariVC(_ sender: Any) {
if let url = URL(string: "url string") {
let config = SFSafariViewController.Configuration()
config.entersReaderIfAvailable = true
let vc = SFSafariViewController(url: url, configuration: config)
present(vc, animated: true)
}
}
Topic:
Programming Languages
SubTopic:
Swift
Tags: