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 | Required | Example Value |
---|---|---|---|
api | the name of any of the inbuilt bridges | Yes | toast |
Response Attributes
Success:
Parameter | Description | Example Value |
---|---|---|
available | Boolean | true |
Error Responses:
Parameter | Description | Example Value |
---|---|---|
error | Error | 2 |
message | Error message | Invalid parameter |
ERROR CODES
code | Description |
---|---|
2 | Invalid parameter |
REQUEST CODERESPONSE CODE
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))
});