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

MethodDescriptionSupported in Emulator
launchBrings up an app with an app ID.Yes
getAppLoadStatusReturns 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

NameRequiredTypeDescription
idRequiredStringThe ID of the app to launch.
paramsOptionalObjectThe object that contains the parameters for the target application.

Call returns

NameRequiredTypeDescription
returnValueRequiredBooleanThe flag that indicates the success/failure of the request.
  • true: Success
  • false: Failure
errorCodeOptionalNumbererrorCode contains the error code if the method fails. The method returns errorCode only if it fails.
See the Error Codes Reference of this method for more details.
errorTextOptionalStringerrorText contains the error text if the method fails. The method returns errorText only if it fails.
See the Error Codes Reference of this method for more details.

Error reference

Error CodeError Message
-1General errors.
-2Fail to read schema.
-3No free memory.
-4Failed to allocate memory while launching an app.
-5File download is not supported.
-6No handler for target URI.
-101The app was not found.
-102The app has been locked.
-103Security checks verified failed.
-104Cannot launch a privileged app on development mode from developer apps path.
-105Invalid id is specified.
-106Unsupported app type.
-107Cannot launch the last app by killing a foreground app when another app is launched.
-201Waiting for a native app.
-202Failed to native app launch process.
-203The native app is already launching.
-300General Callchain errors.
-301Failed to download RO (Right Objects).
-302Failed to check DRM.
-303Failed to check App Signing.
-304Failed to get setting value.
-305Failed to match Pincode.
-306Pin is not matched.
-307Failed to send launch event.
-308Failed to find LaunchPoint.
-309Failed to register kind to DB.
-310Failed to register Permission.
-311EULA 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

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

Call returns

NameRequiredTypeDescription
returnValueRequiredBooleanThe flag that indicates the success/failure of the request.
  • true: Success
  • false: Failure
existOptionalBooleanThe 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.
errorCodeOptionalNumbererrorCode contains the error code if the method fails. The method returns errorCode only if it fails.
See the Error Codes Reference of this method for more details.
errorTextOptionalStringerrorText contains the error text if the method fails. The method returns errorText only if it fails.
See the Error Codes Reference of this method for more details.

Error reference

Error CodeError Message
1Invalid 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