WebToAppMaker

JavaScript Bridge

Updating the App Bar at Runtime

Dynamically update the App Bar title, actions, colors, visibility, and enabled state for the current Android app session.

Before you start

  • A generated Android build that includes this runtime handler
  • Website code that checks window.webtoapp before sending the message

Configure and verify

  1. Detect the bridge

    Check window.webtoapp.postMessage so the same page remains safe in a normal browser.

  2. Send the App Bar patch

    Place App Bar values under updates.modules.app-bar.settings. Unspecified dashboard values remain unchanged.

    The Flutter shell rebuilds immediately and reapplies system-bar styling when App Bar colors or status-bar behavior change.

  3. Keep saved defaults in the dashboard

    Runtime changes last for the current app session. Relaunching the app restores the settings compiled into the APK.

Runtime example

webtoapp.postMessage(JSON.stringify({
  type: "update_settings",
  updates: {
    modules: {
      "app-bar": {
        enabled: true,
        settings: {
          default_title: "Account",
          light_background: "#0F766E",
          actions: [
            { icon: "e88a", title: "Home", action: "https://example.com" }
          ]
        }
      }
    }
  }
}));

Accepted names

Session scope

Test before release

  • Bridge availability is checked
  • Title and colors update immediately
  • Actions use valid URLs
  • Browser fallback remains usable