Show Desktop Add Guide Bubble
Note: There are permission restrictions. If you need to implement this feature, please contact the Mini Program team for authorization.
methodName: showAddHomeTipsToast
Additional Parameters:
Property | Type | Required | Default | Description |
---|---|---|---|---|
showType | Number | Yes | Bubble type. 1: Long bubble, 2: Short bubble. | |
showDelayTime | Number | Yes | Time in milliseconds for the bubble to appear after opening the Mini Program. Must be greater than 0, or the bubble will not appear. | |
closeDelayTime | Number | Yes | Time in milliseconds for the bubble to close after appearing. Must be greater than 0, or the bubble will close immediately after appearing. | |
message | String | No | Bubble message. |
Success Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | String | Describes whether the interface call was successful or not. "true" for success, "false" for failure. |
Fail Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | String | Describes whether the interface call was successful or not. "true" for success, "false" for failure. |
errMsg | String | Error message. errMsg enumeration: 1. $showType is not supported: AS10002 |
Example Usage
const dlt = window['@transsion/byteh5bridge'];
const canCallDlt = dlt && window.dltms && window.dltms.isMiniShellGame();
if (canCallDlt) {
dlt.callApi('showAddHomeTipsToast', {
showType: 1,
showDelayTime: 5000,
closeDelayTime: 3000,
message: 'Click this',
success: (res) => {
console.log('Success: ', res);
},
fail: (res) => {
console.log('Fail: ', res);
},
complete: (res) => {
console.log('Complete: ', res);
},
});
}