Application Manager

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

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

Methods

Method

Description

Supported in Emulator

launch

Brings up an app with an app ID.

Yes

getAppLoadStatus

Returns whether the app with the given app ID is installed.

Yes

(Emulator 5.0 or higher)

launch

Description

Launches an app that corresponds to the given app ID. You can use this method to open your service or app. For example, a user can download 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 the JSON object when launching an app. This method could be called multiple times over for the same app with different parameters. The app should handle these overtime requests. Generally, the app is re-launched for every request. To parse a parameter and handle your app, see App Lifecycle.

Parameters

Name

Required

Type

Description

id

Yes

String

The ID of the app to launch.

params

No

Object

The object that contains the parameters for the target application.

Call returns

NameRequiredTypeDescription
returnValue
Yes
Boolean
The flag that indicates the success/failure of the request.
  • true: Success
  • false: Failure
errorCode
No
Number
`errorCode` contains the error code if the method fails. The method returns `errorCode` only if it fails.
See the Error code reference of this method for more details.
errorText
No
String
`errorText` contains the error text if the method fails. The method returns `errorText` only if it fails.
See the Error code reference of this method for more details.

Error code 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

getAppLoadStatus

Description

Returns whether the app with the given ID is installed.

If you try to launch an app that is not installed on webOS TV, an error occurs. To check whether the app exists or not before launching the app, use this method. This method is available on webOS TV 4.0 or higher.

Parameters

Name

Required

Type

Description

appId

Yes

String

The ID of the app to be checked whether it is installed.

Call returns

NameRequiredTypeDescription
returnValue
Yes
Boolean
The flag that indicates the success/failure of the request.
  • true: Success
  • false: Failure
exist
No
Boolean
The flag that indicates whether the app exists or not.
  • true: The app with the given ID is installed.
  • false: The app with the given ID is not installed.
errorCode
No
Number
`errorCode` contains the error code if the method fails. The method returns `errorCode` only if it fails.
See the Error code reference of this method for more details.
errorText
No
String
`errorText` contains the error text if the method fails. The method returns `errorText` only if it fails.
See the Error code reference of this method for more details.

Error code reference

Error Code

Error Message

1

Invalid `appId` specified. This error is returned when the `appId` parameter is empty.

Example

// One-time call
// Checking app installation
var request = webOS.service.request('luna://com.webos.applicationManager', {
  method: 'getAppLoadStatus',
  parameters: { appId: 'com.yourdomain.callee' },
  onSuccess: function (inResponse) {
    if (inResponse.exist) {
      console.log('The app exists');
      // To-Do something
    } else {
      console.log('The app does not exist');
      // To-Do something
    }
  },
  onFailure: function (inError) {
    console.log('Failed to check app installation');
    console.log('[' + inError.errorCode + ']: ' + inError.errorText);
    // To-Do something
    return;
  },
});

Return example

// Success return
{
  "exist": true,
  "returnValue": true
}

See also

No Headings