has.getLaunchOptionsSync(): Object
Obtains the parameters for starting the atomic service. They are consistent with the callback parameters defined by the app.
Since: 1.0.0
Return value
An object containing the following fields.
Name | Type | Description |
|---|---|---|
path | string | Path of the page in the atomic service launched. |
scene | string | Scene. |
query | object | Parameter on the page. |
referrerInfo | object | Referrer information. |
Description of referrerInfo
Name | Type | Description |
|---|---|---|
packageName | string | Package name of the source application or atomic service. |
extraData | Object | Parameter passed from the source application or atomic service. It is effective only in has.navigateToAtomicService and has.navigateBackAtomicService. |
Example
const launchOptions = has.getLaunchOptionsSync(); console.log(launchOptions.path);
has.getEnterOptionsSync(): Object
Obtains the parameters for starting the atomic service. In the case of cold start, the return value is consistent with the callback parameter of App.onLaunch. In the case of hot start, the return value is consistent with the callback parameter of App.onShow.
Since: 1.0.4
Return value
An object containing the following fields.
Name | Type | Description |
|---|---|---|
path | string | Path of the page in the atomic service launched. |
scene | string | Scene. |
query | Object | Parameter on the page. |
referrerInfo | Object | Referrer information. |
Description of referrerInfo
Name | Type | Description |
|---|---|---|
packageName | string | Package name of the source application or atomic service. |
extraData | Object | Parameter passed from the source application or atomic service. It is effective only in has.navigateToAtomicService and has.navigateBackAtomicService. |
Example
const enterOptions = has.getEnterOptionsSync(); console.log(enterOptions.path);