目录

Lifecycle

has.getLaunchOptionsSync

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

Returns

An object containing the following fields.

Parameter Type Description
path string Path for starting the atomic service page.
scene string Scene.
query Object Parameters for starting the atomic service page.
referrerInfo Object Source information.

referrerInfo parameters

Parameter Type Description
packageName string Package name of the source application or atomic service.
extraData Object Parameters passed by the source application or atomic service.

Example:

const launchOptions = has.getLaunchOptionsSync();
console.info(launchOptions.path);

has.getEnterOptionsSync

has.getEnterOptionsSync(): Object

Obtains the parameters for starting the atomic service. In the case of cold start, the return value is consistent with that of the callback parameter of App.onLaunch. In the case of hot start, the return value is consistent with that of the callback parameter of App.onShow.

Since: 1.0.4

Returns

An object containing the following fields.

Parameter Type Description
path string Path for starting the atomic service page.
scene string Scene.
query Object Parameters for starting the atomic service page.
referrerInfo Object Source information.

referrerInfo parameters

Parameter Type Description
packageName string Package name of the source application or atomic service.
extraData Object Parameters passed by the source application or atomic service.

Example:

const enterOptions = has.getEnterOptionsSync();
console.info(enterOptions.path);