iOS - in app with SFSafariViewController unable to load another host in iframe

I am trying to load the host1 page, it contains iframe and the URL for the iframe is host2. But iframe with URL host2 is not loading properly.

I am loading host1 page through SFSafariViewController. If I load the same thing with the iPhone safari browser then it is working fine but not working with SFSafariViewController. As per my understanding, WKWebview has some limitations but SFSafariViewController doesn't have but still facing the issue.

I have tried the below options also in iOS14.5.1 but still, it is not working:
  • Enabled Allow Cross-Website Tracking by using NSCrossWebsiteTrackingUsageDescription in info.plist

  • Enabled Allow Tracking by using Privacy - Tracking Usage Description in info.plist

  • used WKAppBoundDomains also.

am I missing anything, please help me out?

am I missing anything

Yes, you miss showing the code…
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 for reference

I am using the below code to load the URL in SFSafariViewControl

Code Block
@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)
    }
  }


iOS - in app with SFSafariViewController unable to load another host in iframe
 
 
Q