WebToAppMaker

JavaScript Bridge

Updating Bottom Navigation at Runtime

Dynamically update Bottom Navigation items, appearance, enabled state, and selected tab 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

    Only send runtime updates when window.webtoapp.postMessage is available. Keep the website usable in a normal browser.

  2. Send the navigation patch

    Place the patch under updates.modules.bottom-nav.settings. Unspecified saved values remain unchanged.

    Use enabled to show or hide the module and selected_index to select a tab after replacing items.

  3. Keep saved defaults in the dashboard

    Runtime changes last for the current app session. The next app launch starts from the settings compiled into the APK.

Runtime example

webtoapp.postMessage(JSON.stringify({
  type: "update_settings",
  updates: {
    modules: {
      "bottom-nav": {
        enabled: true,
        settings: {
          selected_index: 1,
          items: [
            { icon: "e88a", title: "Home", action: "https://example.com" },
            { icon: "e88e", title: "Account", action: "https://example.com/account" }
          ]
        }
      }
    }
  }
}));

Accepted names

Session scope

Test before release

  • Bridge availability is checked
  • Every item has a valid action URL
  • Selected index exists after item replacement
  • Browser fallback remains usable