HomeDocs
Skip to main content

Get Mini Program Launch Options

methodName: getLaunchOptions

Additional Parameters:

None

Success Callback Function

Parameters

Object res

PropertyTypeDescription
successStringDescribes whether the interface call was successful or not. "true" for success, "false" for failure.
queryStringThe current mini program's query, parsed from the query field of the launch options. If there are no launch parameters, this will be an empty string.
pathStringThe current mini program's page address.
scene_idStringThe launch scene.
referrerInfoObjectInformation about the source of the launch.

scene_id Scene Values

Scene ValueScene Description
100000Default value when the scene cannot be determined
100001Negative One-Screen Search
100002Negative One-Screen Scan
100003Negative One-Screen Feeds Card
100004Negative One-Screen App Card
100005Business Promotion
100006Desktop Shortcut
100007MiniAppCenter - Recently Used
100008MiniAppCenter - My Favorites
100009MiniAppCenter - Recommendations
100010MiniAppCenter - Search

Object referrerInfo

PropertyTypeDescription
appIdStringThe appId of the source mini program
extraDataObjectData passed from the source mini program

Object extraData (Default)

PropertyTypeDescription
queryStringThe current mini program's query, parsed from the query field of the launch options. If there are no launch parameters, this will be an empty string.
modeStringDebug mode: DEBUG. If there are no launch parameters, this will be an empty string.
versionStringThe version number of the mini program dev version. If the mode is debug, a version number is required.
pageStringThe specified mini program address from social sharing. If there are no launch parameters, this will be an empty string.

Fail Callback Function

Parameters

Object res

PropertyTypeDescription
successStringDescribes whether the interface call was successful or not. "true" for success, "false" for failure.
errMsgStringError message.

Example Usage

const dlt = window['@transsion/byteh5bridge'];
const canCallDlt = dlt && window.dltms && window.dltms.isMiniShellGame();

if (canCallDlt) {
dlt.callApi('getLaunchOptions', {
success: (res) => {
console.log('Success: ', res);
},
fail: (res) => {
console.log('Fail: ', res);
},
complete: (res) => {
console.log('Complete: ', res);
},
});
}
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.