POSTPaytmPushWindow JS API
Use Case
PaytmPushWindow is used to push a new window to show new page with a transition animation. It adds a page to the stack and can be launched with custom startup params.
PaytmPushWindow will Open the url page will not close the existing page, pay attention to open the number, do not open too much to affect performance. It is recommended that the same application PaytmPushWindow level should not exceed 5 layers, otherwise it will affect the user experience and may cause the application to crash.
Request Attributes
Content format: JSON
ATTRIBUTE | DESCRIPTION |
---|---|
url mandatory |
URL to be opened in new window Example: https://paytm.com |
appId mandatory |
appUnique Id or a valid subapp Id(String) Example: WhitelistedAppUniqueIdorSubAppId |
param.showTitleBar optional |
Title Bar of the window Example: true |
param.pullRefresh optional |
To on refresh on pull Example: true |
param.defaultTitle optional |
Default title Example: Welcome |
List of Supported Parameters(param in Request Attributes)
ATTRIBUTE | DESCRIPTION |
---|---|
defaultTitle string |
The default title, displayed on the title bar before the page is first loaded Comments: Set this property to have a title if not included in the application code. If a title is defined in the application code, it will override the mentioned title mentioned in this property(A change of title will be visible to user on page load). Default: "" |
showLoading bool |
Whether to display the global chrysanthemum before the page is loaded Comments: Whether to display the global chrysanthemum before the page content is fully loaded, during which the user is prevented from operating the page. **Warning: the chrysanthemum continues until the first screen network request is completely finished** Default: FALSE |
readTitle bool |
Whether to read the page title displayed on the titleBar Comments: Set this to false and use with defaultTitle to add your custom title on runtime. Default: TRUE |
pullRefresh bool |
Whether to support pull-down refresh Comments: Works only if canPullDown is True. Does not work in iOS. Default: FALSE |
canPullDown bool |
Whether the page supports drop-down Comments: Use only if it fits your UX. If the view is long, This property can cause uncertain UX issues while scrolling. Default: TRUE |
showTitleLoading bool |
Whether to display a small chrysanthemum to the left of the title of the TitleBar Default: FALSE |
showProgress bool |
Shows a progress line for to provide a UX for loading Comments: The progress line will be visible below the titlebar when the page is being loaded. In case of no titlebar, The progress line will still be visible on the top. Default: TRUE |
Response Attributes
Success
ATTRIBUTE | DESCRIPTION |
---|---|
data | Boolean Example: true |
Error Responses
ATTRIBUTE | DESCRIPTION |
---|---|
error | Error Example: 2 |
message | Error message Example: Invalid parameter |
ERROR CODES
CODE | DESCRIPTION |
---|---|
2 | Invalid parameter |
REQUEST
RESPONSE
JAVASCRIPT
const requestObject = {
url: 'https://paytm.com',
appId: 'WhitelistedAppUniqueIdorSubAppId',
param: {
showTitleBar: false,
pullRefresh: true,
defaultTitle: "Welcome!"
}
}
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('paytmPushWindow', requestOb ject)
});