For the complete documentation index, see llms.txt. This page is also available as Markdown.

External Browser API

Open links in the device’s default browser using the WebToNative JavaScript API. Control external URL handling in your mobile app.

To load in external or mobile default browser.

You need to append "loadIn=defaultBrowser" in query parameter of the url you are trying to load.

<a href="https://www.example.com?loadIn=defaultBrowser">Load In Browser</a>
or 
window.location.href = "https://www.example.com?loadIn=defaultBrowser";

*It works for both Android and iOS.

The below function is supported in Android and you'll need to import the javascript file in your website before starting from this link.

WTN.openUrlInBrowser("https://www.webtonative.com"); 
//pass the url you want to open in the external browser.
import { openUrlInBrowser } from "webtonative";

openUrlInBrowser("https://www.webtonative.com");
//pass the url you want to open in the external browser.

Last updated