This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import useAppMessage from "./hooks/useAppMessage"; | |
import "./App.css"; | |
function App() { | |
const { appMessage, sendAppMessage } = useAppMessage(); // appMessage is the message received from the Swift APP | |
const handlePlay = () => { | |
sendAppMessage("Hello from page!");//Send message to the Swift APP | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import WebKit | |
struct WebView: UIViewRepresentable { | |
let urlString: String = "http://localhost:3000" | |
class Coordinator: NSObject, WKNavigationDelegate, WKScriptMessageHandler { | |
var webView: WKWebView? | |
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { |