Skip to Content
GuidesMobile WebView

Mobile WebView

GoCharting does not ship separate iOS / Android chart SDKs. Native apps load the JavaScript SDK inside a WebView and talk to it over a bridge.

Supported hosts:

  • React Native (react-native-webview)
  • Flutter (WebView / JavascriptChannel)
  • Android (WebView + JavascriptInterface)
  • iOS (WKWebView + message handlers)

Pattern

  1. Host a page that calls createChart(..., { isNativeApp: true }).
  2. Keep window.chart (or similar) for native → JS commands.
  3. Listen for sendToNative / appCallback messages for JS → native events.
  4. Drive symbol, interval, orders, and sheets from native chrome.
window.chart = createChart("#chart", { symbol: "BYBIT:FUTURE:BTCUSDT", interval: "1m", datafeed: myDatafeed, licenseKey: "YOUR_LICENSE_KEY", isNativeApp: true, // mobile canvas; host owns toolbars appCallback: (event) => { // Also posted to the native bridge when isNativeApp is true }, });
FlagBehavior
isNativeApp: trueMobile canvas; JS bars/context menu suppressed; events posted natively
touchMode: trueFull JS mobile Chart-tab chrome (bars + menus)

For production native shells, prefer isNativeApp: true.

Full guide

See Mobile Integration for bridge snippets, message shapes, and platform checklists.

Package example: examples/flutter-webview.html (SDK package).

Last updated on