JavaScript Bridge

Communicate with the native app layer

The JavaScript Bridge allows your web application to send messages to the native Flutter app. This is done using the standard window.postMessage API or the Flutter-specific channel.

Core Syntax

// Check if running in Flutter app
if (window.FlutterWebView) {
    window.FlutterWebView.postMessage(JSON.stringify({
        type: 'messageType',
        // ... additional data
    }));
}

Platform Detection

You can detect if your site is running inside the WebToApp wrapper by checking for the FlutterWebView object on the window.

WebToApp - Convert Any Website to iOS & Android Apps