PaytmPushWindow 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
Parameter | Description | Required | Example Value |
---|---|---|---|
url | URL to be opened in new window | Yes | https://paytm.com |
appId | appUnique Id or a valid subapp Id(String) | Yes | WhitelistedAppUniqueIdorSubAppId |
param.showTitleBar | Title Bar of the window | No | true |
param.pullRefresh | To on refresh on pull | No | true |
param.defaultTitle | Default title | No | Welcome |
List of Supported Parameters(param in Request Attributes)
Sr.No. | Name | Type | Description | Defaults | Comments |
---|---|---|---|---|---|
1 | defaultTitle | String | The default title, displayed on the title bar before the page is first loaded | "" | 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). |
2 | showLoading | Bool | Whether to display the global chrysanthemum before the page is loaded | FALSE | 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** |
3 | readTitle | Bool | Whether to read the page title displayed on the titleBar | TRUE | Set this to false and use with defaultTitle to add your custom title on runtime. |
4 | pullRefresh | Bool | Whether to support pull-down refresh | FALSE | Works only if canPullDown is True. Does not work in iOS. |
5 | canPullDown | Bool | Whether the page supports drop-down | TRUE | Use only if it fits your UX. If the view is long, This property can cause uncertain UX issues while scrolling. |
6 | showTitleLoading | Bool | Whether to display a small chrysanthemum to the left of the title of the TitleBar | FALSE | |
7 | showProgress | Bool | Shows a progress line for to provide a UX for loading | TRUE | 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. |
Response Attributes
Success:
Parameter | Description | Example Value |
---|---|---|
data | 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={
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)
});