appinfo.json

The webOS TV Platform uses app metadata to identify an app and acquire other information required to install and run the app. So, before packaging your app, you must write metadata of the app in a file called appinfo.json. The appinfo.json file is located in your app's root directory and contains a single JSON object.

Tip: JSON syntax
Here are a few tips that might help you with JSON syntax.
  • Do not include any comments (/* or //).
  • Use double quotes, not single quotes, around properties.

appinfo.json reference

The properties consist of mandatory properties and optional properties. The following properties listed below are especially required for submitting your app to the LG Content Store. Make sure you specify these properties properly.

  • id
  • title
  • type
  • main
  • largeIcon

The following example shows the appinfo.json file that consists of the various properties.

{
    "id": "com.mycompany.app.appname",
    "title": "AppName",
    "main": "index.html",
    "icon": "AppName_80x80.png",
    "largeIcon": "AppName_130x130.png",
    "type": "web",
    "vendor": "My Company",
    "version": "1.0.0",
    "appDescription": "This's an app tagline",
    "resolution": "1920x1080",
    "bgColor": "red",
    "iconColor": "red",
    "bgImage": "AppName_Preview.png",
    "closeOnRotation": false
    "disableBackHistoryAPI": false,
    "handlesRelaunch": false,
    "splashBackground": "AppName_Splash.png",
    "splashColor": "#111111",
    "splashFitModeOnPortrait": "width",
    "requiredMemory": 20,
    "supportPortraitMode": true,
    "supportTouchMode": "virtual",
    "transparent": false,
    "virtualTouch": {
        "verticalThreshold": 20,
        "horizontalThreshold": 50,
        "positionEventOnPress": true,
        "shortTouchThreshold": 30
    },
    "accessibility": {
      "supportsAudioGuidance": true
    }
}

icon

This property is mandatory and the String type. Specify the small icon file of your app, 80x80 pixels in PNG format. The file path must be relative to the appinfo.json file. This icon file is required for app submission and used for app testing only. In LG Content Store, another icon file of 400x400 pixels that you upload separately at LG Seller Lounge is used, instead of this icon, after being auto-resized.

id

This property is mandatory and the String type. Specify your app ID. For example, com.newcompany.app.myapp. Every app MUST have a unique ID, formed according to the reverse DNS naming conventions. The Launcher uses this ID to identify your app and displays it with the title. The app ID cannot be changed once the app is published.

  • Must create an ID only with lowercase letters (a-z), digits (0-9), minus signs, and periods. It must start with an alphanumeric character and be at least two characters long.
  • Must not start with the following reserved domain names:com.palm, com.webos, com.lge,com.palmdts
  • Start the ID with a reverse domain of the company/institution. (Recommended)
  • Finish the ID with the subdomain app.app-name. (Recommended)

largeIcon

This property is mandatory and the String type. Specify your large icon file of your app, 130x130 pixels in PNG format. The file path must be relative to the appinfo.json file. This large icon file is required for app submission and used for app testing only. In LG Content Store, another icon file of 400x400 pixels that you upload separately at LG Seller Lounge is used, instead of this large icon, after being auto-resized.

main

This property is mandatory and the String type. Specify the launch point for your app. The file path must be relative to the appinfo.json file and needs to point to an HTML file. The default isindex.html.

title

This property is mandatory and the String type. Specify the app title to be shown on the Launcher and the app window.

TIP: HTML <title> element
You can use the HTML <title> element for a subtitle in your app. The app version or vendor name is recommended for the subtitle.

type

This property is mandatory and the String type. Specify your app type. Only web is allowed currently.

vendor

This property is mandatory and the String type. Specify your app owner to be used in the launcher and deviceinfo dialogs.

version

This property is mandatory and the String type. Specify your app version number, comprised of three non-negative integers separated by period. The default value is 1.0.0.

  • DO NOT contain leading zeroes. Example: 2.1.0 (not 002.1.0)
  • The major, minor, and revision numbers are all mandatory; if any is missing, the app may not be installed. Example: 2.1.0 (not2.1)
  • Each number can have up to nine digits. In other words, the maximum version possible is 999999999.999999999.999999999.
  • The major, minor, and revision numbers are discrete. For example,1.5.3 is a lower version than 1.15.3.
  • Once you upload a certain version of your app on the LG Content Store, you cannot upload the same version again. To upload the app, you must increase the version number.

appDescription

This property is optional and the String type. Specify brief information about your app. Think of this as a short tagline for the app. It cannot exceed 60 characters.

bgColor

This property is optional and the String type. This property is available only in webOS TV v1.x and v2.x. In later versions, this property is ignored. Specify the background color of your app to be displayed on the Launcher. This property is used if thebgImage is not provided or unavailable. You can specify the color in a hex value or with an HTML color name. For example, "bgColor":"#5e70a2", "bgColor":"#ffffff".

bgImage

This property is optional and the String type. This property is available only in webOS TV v1.x and v2.x. In later versions, this property is ignored. Specify the background image of your app to be displayed when activated on the Launcher. The image must be in PNG format, and the image size must be 1920 x 1080 pixels. The file path must be relative to the appinfo.json file. For example, image/myappbgimage.png.

closeOnRotation

This property is optional and the Boolean type. Set whether to close your app when the screen is rotated vertically. This property is applied to the StanbyME model only.

  • false (default) – Your app runs regardless of whether the screen is rotated.
  • true - Your app is closed with a notice when the screen is rotated vertically.

disableBackHistoryAPI

This property is optional and the Boolean type. Set whether your app receives the back button event when the back button is pressed on Magic Remote. For more information about this property, see Back Button.

  • false (default) - Your app does not receive the back button event. Instead, the webOS TV Platform manages the history using standard HTML history API such as history.pushState(),history.back(), and popState event.
  • true - Your app receives the back button event. You should implement how to process the back button event in your app.

handlesRelaunch

This property is optional and the Boolean type. Set whether your app handles the webOSRelaunch event.
When your app is re-launched, a webOSRelaunch event occurs, and the webOS TV Platform passes the webOSRelaunchevent to your app. Then, depending on the value of thishandlesRelaunch property, your app either handles the event on its own or not.

  • false (default) - Your app does not handle thewebOSRelaunch event. The webOS TV Platform automatically displays your app in the full-screen mode.
  • true - Your app handles the webOSRelaunch event in the background for a while and then, comes to the foreground by calling the PalmSystem.activate() method. See App Lifecycle for more details.

iconColor

This property is optional and the String type. Specify the background color for your app tile. The default value is white.

requiredMemory

This property is optional and the Number type. Set the minimum amount of memory in megabytes required to run your app. This value does not need to be the same as the maximum memory usage consumed by your app.

resolution

This property is optional and the String type. Specify the screen resolution for graphics display of your app. webOS TV does not support UHD resolution for web apps. Supported resolutions are as follows:

  • "1920x1080" (default) - FHD resolution
  • "1280x720" - HD resolution
To get the app resolution for graphics display, use window.innerWidth and window.innerHeight properties.

splashBackground

This property is optional and the String type. Specify the background image to be displayed while your app is being loaded. The path must be relative to the appinfo.json file. The image file must have 1920 x 1080 resolution in PNG format.

splashColor

This property is optional and the String type. This property is applied to the StanbyME model only. Specify the background color (RGB) of the splash image. The default value is gray.
You can set the color by specifying a hexadecimal (hex) value or an HTML color name. For example, the following values are acceptable:#000000 and black.

splashFitModeOnPortrait

This property is optional and the String type. This property is applied to the StanbyME model only. Specify the fit mode for the splash image in portrait mode. It works only if your app supports portrait mode.

  • “none” (default) - The splash image is displayed in its original size.
  • “width” - The splash image is resized to fit the width of the screen.

supportPortraitMode

This property is optional and the String type. This property is applied to the StanbyME model only. Specify whether your app supports portrait mode.

  • "false" (default) - Your app does not support portrait mode.
  • "true" – Your app supports portrait mode. The splash image is displayed with the background color set by the splashColor property.

supportTouchMode

This property is optional and the String type. This property is applied to the StanbyME model only. Specify how to handle touch events.

  • “none” (default) – Your app does not handle touch inputs.
  • “full” - Your app handles touch input. You can implement event handlers for touch inputs using the standard web API.
  • “virtual” - If a touch event occurs, the webOS TV Platform sends it to your app as a keyboard or mouse event.

transparent

This property is optional and the Boolean type. Set the transparency of your app's background. If you do not set the background color or background image, the system background, which is black, is displayed.

  • false (default) - The transparency rate of the app background is decreased and the system background is shown as a little grey color.
  • true - The system background is displayed clearly.

virtualTouch

This property is optional and the virtualTouch object type. This property is applied only when thesupportTouchMode property is set to virtual in the StanbyME model. Set detail values for touch inputs. The object consists of values for the detail thresholds of converting touch inputs into keyboard or mouse events.

virtualTouch object

verticalThreshold

This property is optional and the Number type. You can set the threshold (10-100 px) that triggers an event for touch and drag in the vertical direction.
If a user touches the screen and moves over the threshold value, it is considered a drag operation, and a key event occurs. This is, if you set the threshold value small, a key event in the vertical direction (up, down) occurs even with a short swipe. Therefore, the smaller you set the threshold, the more key events occur when a user swipes the screen at the same length.

  • The default value is 40.
  • When smaller than 10, it is set to 10.
  • When bigger than 100, it is set to 100.

horizontalThreshold

This property is optional and the Number type. You can set the threshold (10-100 px) that triggers an event for touch and drag in the horizontal direction.
If a user touches the screen and moves over the threshold value, it is considered a drag operation, and a key event occurs. This is, if you set the threshold value small, a key event in the horizontal direction (left, right) occurs even with a short swipe. Therefore, the smaller you set the threshold, the more key events occur when a user swipes the screen at the same length.

  • The default value is 40.
  • When smaller than 10, it is set to 10.
  • When bigger than 100, it is set to 100.

positionEventOnPress

This property is optional and the Boolean type. You can set whether to send a touch press (shorter than 200ms) event as a mouse position event.

  • false (default) - A touch press event is not sent to your app, but a touch release event is sent to your app as a key or mouse event.
  • true - A touch press event is sent to your app as a mouse position event, and a touch release event is sent to your app as a key or mouse event.

shortTouchThreshold

This property is optional and the Number type. You can set the click threshold (10-50 px) to be recognized as short touch (like a click).
It is considered a click if a dragging distance is less than the shortTouchThreshold value. Swiping more than the shortTouchThreshold value will not send a click event to your app.

  • The default value is 10.
  • When smaller than 10, it is set to 10.
  • When bigger than 50, it is set to 50.

accessibility

This property is optional and the accessibility object type. This object is for supporting accessibility functions.

accessibility object

supportsAudioGuidance

This property is optional and the Boolean type. You can set whether to support audio guidance in your app.

  • false (default) - Your app does not support audio guidance.
  • true - Your app supports audio guidance.
Note
To support audio guidance, your app should use ARIA tag. It is supported on webOS TV 3.0 or higher but not fully supported on webOS TV 3.x. For more information about ARIA, see https://www.w3.org/TR/wai-aria/.

No Headings