Why's SFSafariViewController's "Listen to Page" button disabled for the same link which is enabled in the real iOS Safari

I am using SFSafariViewController to open links in my app. Regardless of which link, the "Listen to Page" button is disabled. However, it's enabled and works fine if the same link is opened in the real iOS Safari.

Here's my code:

@IBAction func showSafari(_ sender: UIButton) {
    guard let url = URL(string: "https://dotat.at/@/2024-01-29-four-point-egg.html") else {
        return
    }
    var safariVC : SFSafariViewController
    if #available(iOS 11.0, *) {
        let config = SFSafariViewController.Configuration()
        config.barCollapsingEnabled = true
        safariVC = SFSafariViewController(url: url, configuration: config)
        safariVC.dismissButtonStyle = .close
    } else {
        safariVC = SFSafariViewController(url: url)
    }
    navigationController?.pushViewController(safariVC, animated: true)
}

Here's how it looks in my app:

enter image description here

And here's the same in real iOS Safari:

enter image description here

Is there some configuration or something I am missing? This is on iOS 17.3 on iPhone 13. I have tested it on multiple devices.

Upvotes: 1

Views: 102

Answers (0)

Related Questions