Listen to Client Side Messages on Swift (iOS)
WebView Handler Name Requirement
When registering your WKWebView message handler, the name must be exactly "ReactNativeWebView". The Coinflow checkout page checks for window.webkit.messageHandlers.ReactNativeWebView to determine if it’s running in a supported mobile WebView. If this handler doesn’t exist with this exact name, the checkout UI will not render properly.
1. Define API Models
2. Handle API Calls
3. Create a WebView
4. Show Webview
5. Handle Result
Response Example
Define API Models for Request and Response
Create models matching Coinflow’s API structure
Fetch a Checkout Link
Implement a ViewModel that fetches the checkout URL.
Create a WebView Representable
Implement a WebView that loads the Coinflow checkout URL and listens for messages.
Update ContentView to Show Loading State and WebView
Connect everything in your ContentView.
Handle Transaction Results
You can update the UI based on transaction status

