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

PARAMETER DESCRIPTION
url
mandatory
URL of the file to download
Example: https://dummyurl.pdf

Response Attributes

Success:

PARAMETER DESCRIPTION
success Boolean
Example: true
⇾
REQUEST
RESPONSE
JAVASCRIPT
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)
});

 

copy icon