search

openInBrowser JS API

Use Case

openInBrowser is used to download any file in Mini Apps by passing the control to mobile browser eg. PDF.


Note: openInBrowser currently not supported in UAT app.

Request Attributes

Content format: JSON

ParameterDescriptionRequiredExample Value
urlURL of the file to downloadYeshttps://dummyurl.pdf

Response Attributes

Success:

ParameterDescriptionExample Value
successBooleantrue
REQUEST CODE
RESPONSE CODE
JAVASCRIPT
copy content icon
const requestObject={
   url: 'https://dummyurl.pdf',
}
function ready (callback) {
   // call if jsbridge is injected
  if(window.JSBridge) {
   callback && callback();
  } else{
  // listen to jsbridge ready event
  document.addEventListener('JSBridgeReady', 
callback, false);
}}
ready(function () {   JSBridge.call('openInBrowser',requestObject) });