I have a SwiftUI app that launches WKWebView for Twitter, Facebook, etc. The same view in an App Clip won't launch the WKWebView. I tried SFSafariViewController too. These are not listed as frameworks that provide limited to no functionality at runtime for App Clips. Any ideas?
struct WebViewButton: View {
let urlString: String
let buttonText: String
let buttonImage: String
let navText: String
var body: some View {
NavigationLink(destination: SafariView(url: urlString)) {
HStack {
Image(buttonImage)
.resizable()
.frame(width: 20, height: 20)
Text(buttonText)
.font(.system(size: 14))
}
.padding()
}.buttonStyle(ButtonBackgroundStyle())
.navigationBarTitle(Text(navText))
}
}
struct SafariView: UIViewControllerRepresentable {
let url: String
func makeUIViewController(context: UIViewControllerRepresentableContext<SafariView>) -> SFSafariViewController {
return SFSafariViewController(url: URL(string: url)!)
}
func updateUIViewController(_ uiViewController: SFSafariViewController, context: UIViewControllerRepresentableContext<SafariView>) {}
}