package
The sos.management.package
API groups together methods for installing custom Android packages.
Package Management Capabilities
Capability | Description |
---|---|
PACKAGE_INSTALL | If device supports installing packages |
STOP_PACKAGE | If device supports stopping packages |
If you want to check if the device supports those capabilities, use sos.management.supports()
.
Methods
install()
The install()
method installs a particular package from the specified URL.
install(baseUrl: string, packageName: string, version: string, build: string | null): Promise<void>;
Params
Name | Type | Required | Description |
---|---|---|---|
baseUrl | string | Yes | URL where the package is available |
packageName | string | Yes | Name of the Android package |
version | string | Yes | Package version |
build | string | null | Yes | If relevant for your device |
Return value
A promise that resolves when the package is successfully installed.
Possible errors
- If
baseUrl
is not a valid URL - If
packageName
is not a string - If
version
is not a string - If
build
is not a string or null
stop()
The stop()
method stops a certain package.
stop(packageName: string): Promise<boolean>;
Params
Name | Type | Required | Description |
---|---|---|---|
packageName | string | Yes | Name of the android package |
Return value
Resolves to true
if the package was stopped, false
if the package was already stopped before.
API Example
import { sos } from '@signageos/front-applet';
void sos.onReady(async () => {
await sos.management.package.install('https://cdn.your-cms.com', 'io.signageosWebView.app.ota', '2.4.0', 'benq');
await sos.management.package.stop('io.signageosWebView.app.ota');
});