Application Manager

Service URI - luna://com.webos.applicationManager

The Application Manager provides launch method to launch a specified application. You can launch an application directly by using the launch() method with the specified application ID and appropriate arguments.

 

Method

Description

Supported in Emulator

launch

Brings up an application with an application ID.

Yes

 

Open All


launch

Description

Launches an application which corresponds to given application ID. You can use this method to open your service or app. For example, a user can download a content with your service in the background. When downloading content is completed, your service needs to launch your app again.

You can give parameters in JSON object when launching an application. This method could be called multiple times over for the same application with different parameters. The application should handle these overtime requests. Generally, the application is re-launched for every request.

To parse a parameter and handle your application, see App Lifecycle article.

Syntax

launch(String id[, Object params])

Parameters

Name

Required

Type

Description

id

Required

String

ID of application to launch.

params

Optional

Object

Object that contains the parameters for the target application.

Call Returns

Name

Required

Type

Description

returnValue

Required

Boolean

 Flag that indicates success/failure of the request.

  • true: Success

  • false: Failure

errorCode

Optional

Number

errorCode contains the error code if the method fails. The method will return errorCode only if it fails.
See the Error Codes Reference of this method for more details.

errorText

Optional

String

errorText contains the error text if the method fails. The method will return errorText only if it fails.
See the Error Codes Reference of this method for more details.

Error Reference

Error Code

Error Message

-1

General errors.

-2

Fail to read schema.

-3

No free memory.

-4

Failed to allocate memory while launching an app.

-5

File download is not supported.

-6

No handler for target URI.

-101

The app was not found.

-102

The app has been locked.

-103

Security checks verified failed.

-104

Cannot launch a privileged app on development mode from developer apps path.

-105

Invalid id is specified.

-106

Unsupported app type.

-107

Cannot launch the last app by killing a foreground app when another app is launched.

-201

Waiting for a native app.

-202

Failed to native app launch process.

-203

The native app is already launching.

-300

General Callchain errors.

-301

Failed to download RO (Right Objects).

-302

Failed to check DRM.

-303

Failed to check App Signing.

-304

Failed to get setting value.

-305

Failed to match Pincode.

-306

Pin is not matched.

-307

Failed to send launch event.

-308

Failed to find LaunchPoint.

-309

Failed to register kind to DB.

-310

Failed to register Permission.

-311

EULA errors.

Example

// One-time call
// Launching app without parameter
var request = webOS.service.request("luna://com.webos.applicationManager", {
    method: "launch",
    parameters: { "id": "com.yourdomain.callee" },
    onSuccess: function (inResponse) {
        console.log("The app is launched");
        // To-Do something
    },
	onFailure: function (inError) {
		console.log("Failed to launch the app");
		console.log("[" + inError.errorCode + "]: " + inError.errorText);
		// To-Do something
		return;
	}
});

// Launching app with parameters
var request = webOS.service.request("luna://com.webos.applicationManager", {
    method: "launch",
    parameters: {
        "id": "com.yourdomain.callee", 
        "params": {
            "customParam1": "value1",
            "customParam2": "value2"
        }
    },
    onSuccess: function (inResponse) {
        console.log("The app is launched");
        // To-Do something
    },
	onFailure: function (inError) {
	    console.log("Failed to launch the app");
		console.log("[" + inError.errorCode + "]: " + inError.errorText);
		// To-Do something
		return;
	}
});

See Also



Navigation