Native Controls & JS Bridge Functions
Guide for controlling native UI elements and triggering JavaScript functions through the WebtoNative bridge. Enable seamless communication between web content and native apps.
1. Trigger JavaScript Functions via URL Scheme
You can call JavaScript functions inside your WebView directly by using the w2n:// URL scheme.
Syntax:-
w2n://jsFunction:YOUR_JS_CODE
Example:-
w2n://jsFunction:alert("Hello World");
This will execute the JavaScript alert("Hello World") inside the WebView.2. Hide Native Components
You can hide native UI components dynamically using the hideNativeComponents() JavaScript function.
Available Components:
secondary_navigationadmobfloating_buttonconnectbottom_navigationadvanced_bottom_navigationheader
3. Show Native Components
You can show native UI components using the showNativeComponents() JavaScript function.
Available Components:
secondary_navigationadmobfloating_buttonconnectbottom_navigationadvanced_bottom_navigationheader
Feature taken live on 24/11/25
3. Setting Navigation Bar color in android
Set the android system navigation bar color.
4. Pinch to zoom setting control in Android
Control pinch to zoom feature.
5. Invoke Sidebar in Android and iOS
To open side bar in android and iOS call the below url scheme.
6. Hiding the splash screen in Android and iOS
When the splash screen's type is set to JS_TRIGGER (instead of a timer or page-load trigger), the native app waits for the web page to explicitly call window.splashScreenJsTrigger() before hiding the splash screen and navigating forward.
7. Showing a Multi Purpose Modal
Show the multi purpose modal for a specific page by passing that page's modal ID. Use this when you want a particular modal (e.g. an offer, announcement, or prompt) to appear only on a specific page of your app.
The modalId should match the ID configured for the modal on your dashboard. Each page can call this with a different modalId to display its own modal.
Last updated