Reputation: 8752
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:
And here's the same in real iOS Safari:
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