Running in desktop mode -- native bridge not detected. Mock handler active for testing.

JavaScript Bridge Demo

Unified Web ↔ Native Communication (Android & iOS)

Initializing bridge...
Specification
Global: window.jsbridge
Schema: --
Platform: --

Quick start

API

  • jsbridge.ready(): Promise<void>
  • jsbridge.call(action, content?, opts?): Promise<any>
  • jsbridge.on(handler) / jsbridge.off(handler)
  • jsbridge.cancelAll()
  • jsbridge.setDebug(bool)
  • jsbridge.setMockHandler(fn | null)
  • jsbridge.platform'android' | 'ios' | 'desktop'
  • jsbridge.schemaVersion — integer

Message format

Console

Waiting for bridge...

Device & System

Spec & Usage

Safe Area / Insets

CSS Custom Properties

Native automatically pushes --bridge-inset-* CSS properties whenever bars change. Use var(--bridge-inset-top) etc. in your CSS. The insets action is for on-demand JavaScript queries. All values are in dp/pt.

safeArea.top = status bar + top navigation (when visible).
safeArea.bottom = system navigation + bottom navigation (when visible).

Spec & Usage

System Bars Info

Spec & Usage

UI Actions

Spec & Usage

Top Navigation

Spec & Usage

Bottom Navigation

Spec & Usage

System Bars

Spec & Usage

Haptic Feedback

Spec & Usage

Navigation

Spec & Usage

System Actions

Spec & Usage

Lifecycle Events

Native sends focused / defocused events automatically. Current state:

focused
Spec & Usage

Refresh / Push Events

Native sends push events automatically. Latest:

waiting...
Spec & Usage

Secure Storage

Spec & Usage

Analytics (Fire & Forget)

Spec & Usage

Schema Versioning

Spec & Usage

Automated Tests