# webOS Application

This application is designed for platforms that support webOS, such as LG displays.

## Application Name

The application is named `com.lg.app.signage`. This name is used for both the `.ipk` and `.zip` installer packages.
The service name should also follow this naming convention (_refer to the ["Service" section below](#service) for more details_).

> The `.zip` format is a legacy application format that is supported on all platform generations from __webOS 1__ to __webOS 4.1__.

> The `.ipk` format is a newer application format that is only supported by __webOS 3.0 models__ and above.

## Application Structure

### Entry Point

The entry point of the application is located at [src/bundle.ts](src/bundle.ts).

### Service

The service, named `com.lg.app.signage.signagemanagement.service`, runs within the display's NodeJS server.
Its specifications can be found at [services/management.service/services.json](services/management.service/services.json).

The source code for the service can be found in the file [services/management.service/src/main.ts](services/management.service/src/main.ts).

Within the application, the service can be accessed via `luna://com.lg.app.signage.signagemanagement.service`.

:information_source: [webOS JS Service Usage](https://webostv.developer.lge.com/develop/guides/js-service-usage)
:information_source: [webOS Service Object Documentation](https://webostv.developer.lge.com/develop/references/webos-service-reference)

## webOS Emulator and Simulator

LG provides an [Emulator](https://webostv.developer.lge.com/develop/tools/emulator-introduction) (_for older platforms_)
and a [Simulator](https://webostv.developer.lge.com/develop/tools/simulator-introduction) (_for newer platforms_),
theoretically eliminating the need for a physical device during development.
However, it's recommended to avoid using them for the following reasons:

- The firmware versions of the emulator/simulator do not match the firmware version of the physical device.
- The emulator/simulator only has a limited set of features.
- The emulator/simulator lacks important B2B APIs.

Consequently, it's generally better __not to use either of them__.

## Debugging using Ares CLI & Web Inspector

https://gitlab.com/signageos/wiki/-/blob/master/development/core-apps/debugging.md

## webOS Documentation

### Main B2B Documentation

:information_source: http://webossignage.developer.lge.com/

- webOS versions are using different versions of `SCAP` APIs based on the webOS version (v1 to v6). SCAP APIs should be kept up to date.
- there is `CustomJS` API that is adding some additional functionality, that should be kept up to date as well; typically `getWebOSVersion()` function that defines what webOS are the application running on and is needed for new releases
- Ever since v6.5, there has been a **BREAKING CHANGE**, webOS switching from SCAP to `IdCAP` APIs. IdCAP is documented on the same site above.

### Generic webOS Documentation (B2C):

:information_source: https://webostv.developer.lge.com/
