search

checkJSAPI

Use Case

This API allows to check if any inbuilt bridge is available or not before using it in the application.

Request Attributes

Content format: JSON

PARAMETER DESCRIPTION
api
mandatory
the name of any of the inbuilt bridges
Example: toast

Response Attributes

Success:

PARAMETER DESCRIPTION
available Boolean
Example: true

Error Responses:

PARAMETER DESCRIPTION
error Error
Example: 2
message Error message
Example: Invalid parameter

Error Codes:

CODE DESCRIPTION
2 Invalid parameter
REQUEST
RESPONSE
JAVASCRIPT
const requestObject = {
    api: 'toast' // put the name of any of the 
    inbuilt bridges
}

JSBridge.call('checkJSAPI', requestObject,
    function(result) {
        console.log(JSON.stringify(result))
    });

 

copy icon