HomeDocs
Skip to main content

dlt.getLaunchOptions

Introduction

Get the parameters when the mini-program is launched through a social sharing link.

Example Link: http://h5.dlight-app.com/outside?appId=100014&page=pages/feedDetail/feedDetail&query=a%3Daaa%26b%3Dbbb

Parameters

Object object

PropertyTypeDefaultRequiredDescription
successfunctionNoCallback function for a successful API call
failfunctionNoCallback function for a failed API call
completefunctionNoCallback function that is called when the API call is complete (whether successful or not)

object.success Callback Function

Parameters

Object res

PropertyTypeDescription
successstringtrue- Success
querystringThe query parameter of the current mini-program, parsed from the query field of the launch parameters. Note: If there are no launch parameters, the query parameter will be an empty string.
pathstringThe page address of the current mini-program
scenestringCurrently, there is no launch scene, so it defaults to 100000
referrerInforeferrerInfoReferral information

Object referrerInfo

PropertyTypeDescription
appIdstringThe source mini-program
extraDataobjectData sent from the source mini-program

Object extraData (Default)

PropertyTypeDescription
querystringThe query parameter of the current mini-program, parsed from the query field of the launch parameters. Note: If there are no launch parameters, the query parameter will be an empty string.
modestringDebug mode: DEBUG. Note: If there are no launch parameters, the mode parameter will be an empty string.
versionstringThe version number of the mini-program dev version. If the mode is debug, the version number must be present.
pagestringThe address of the specified mini-program from social sharing. Note: If there are no launch parameters, the page parameter will be an empty string.

object.fail Callback Function

Parameters

Object res

PropertyTypeDescription
successstringfalse- Failure

Example Code

// pages/index/index.js
Page({
getLaunchOptions() {
dlt.getLaunchOptions({
success: (res) => {
console.log('success', res);
},
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.