@signageos/front-applet 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +3 -1
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/docs/{js-api/js-applet-basics.md → applet-basics.md} +38 -99
- package/docs/{js-api → content}/js-applet-resources.md +10 -28
- package/docs/{js-api → content}/js-browser.md +24 -36
- package/docs/{js-api → content}/js-command.md +33 -91
- package/docs/{js-api/js-api-debug.md → content/js-debug.md} +2 -3
- package/docs/{js-api → content}/js-device-info.md +4 -5
- package/docs/{js-api → content}/js-display.md +18 -10
- package/docs/{js-api → content}/js-file-system.md +17 -30
- package/docs/{js-api/js-loading-fonts.md → content/js-fonts.md} +21 -44
- package/docs/{js-api → content}/js-hardware.md +6 -9
- package/docs/{js-api → content}/js-iframes.md +3 -3
- package/docs/{js-api → content}/js-input.md +2 -3
- package/docs/{js-api → content}/js-offline-cache-media-files.md +26 -83
- package/docs/{js-api → content}/js-offline-cache-simple-data.md +12 -17
- package/docs/{js-api → content}/js-osd.md +0 -2
- package/docs/{js-api → content}/js-proof-of-play.md +4 -6
- package/docs/{js-api → content}/js-sensors.md +3 -3
- package/docs/{js-api/js-hardware-serial.md → content/js-serial.md} +13 -18
- package/docs/{js-api → content}/js-sync-playback.md +30 -70
- package/docs/{js-api → content}/js-video-inputs-internal-ports.md +16 -34
- package/docs/{js-api → content}/js-video-stream.md +49 -85
- package/docs/{js-api → content}/js-video.md +25 -75
- package/docs/index.md +97 -0
- package/docs/{management-api/10-js-management-application.md → management/js-management-application.md} +16 -32
- package/docs/{management-api/7-js-management-volume.md → management/js-management-audio.md} +4 -6
- package/docs/{management-api/9-js-management-debug.md → management/js-management-debug.md} +5 -18
- package/docs/{management-api/2-js-management-firmware.md → management/js-management-firmware.md} +11 -25
- package/docs/{management-api/1-js-management.md → management/js-management-management.md} +67 -56
- package/docs/{js-api/js-monitoring-commands.md → management/js-management-monitoring-commands.md} +5 -6
- package/docs/{js-api/js-monitors.md → management/js-management-monitors.md} +9 -9
- package/docs/{management-api/11-js-management-network.md → management/js-management-network.md} +17 -43
- package/docs/{management-api/2-js-management-os.md → management/js-management-os.md} +2 -3
- package/docs/{management-api/8-js-management-package.md → management/js-management-package.md} +4 -6
- package/docs/{management-api/4-js-management-power.md → management/js-management-power.md} +10 -15
- package/docs/{management-api/14-js-management-proxy.md → management/js-management-proxy.md} +4 -6
- package/docs/{management-api/3-js-management-remote-control.md → management/js-management-remote-control.md} +5 -20
- package/docs/{management-api/5-js-management-screen.md → management/js-management-screen.md} +27 -81
- package/docs/{management-api/12-js-management-security.md → management/js-management-security.md} +6 -9
- package/docs/{management-api/6-js-management-time.md → management/js-management-time.md} +19 -26
- package/docs/{management-api/13-js-management-wifi.md → management/js-management-wifi.md} +38 -47
- package/es6/FrontApplet/Browser/IOpenLinkOptions.d.ts +4 -0
- package/es6/FrontApplet/Browser/IOpenLinkOptions.js +1 -0
- package/es6/FrontApplet/Browser/IOpenLinkOptions.js.map +1 -1
- package/es6/FrontApplet/Input/IInput.d.ts +11 -0
- package/es6/FrontApplet/Input/IInput.js +3 -0
- package/es6/FrontApplet/Input/IInput.js.map +1 -0
- package/es6/FrontApplet/Input/Input.d.ts +5 -1
- package/es6/FrontApplet/Input/Input.js +6 -0
- package/es6/FrontApplet/Input/Input.js.map +1 -1
- package/package.json +7 -4
- package/docs/js-api/js-api-introduction.md +0 -91
|
@@ -17,7 +17,7 @@ This thread contains basic methods of every Applet used to load necessary config
|
|
|
17
17
|
|
|
18
18
|
## All methods and properties
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
| Methods/Property | Description | Supported since |
|
|
22
22
|
| ----------------- | ----------- | :---------------: |
|
|
23
23
|
| `onReady()` | This method will wait until sOS object library and all dependencies are ready to be used. | 1.0.0 |
|
|
@@ -26,8 +26,7 @@ This thread contains basic methods of every Applet used to load necessary config
|
|
|
26
26
|
| `appletVersion` | Returns current Applet version | JS API `4.5.0`, Front-display `7.8.0`|
|
|
27
27
|
| `config` object | Returns object with key-values set via Timing or as a bundled config| JS API `1.5.0`, Front-display `6.8.0`|
|
|
28
28
|
| `config` object | Returns object with key-values set via Timing or as a bundled config| `1.0.0`|
|
|
29
|
-
| `capabilities` | Enum of device-specific capabilities and features | `1.0.0
|
|
30
|
-
:::
|
|
29
|
+
| `capabilities` | Enum of device-specific capabilities and features | `1.0.0`
|
|
31
30
|
|
|
32
31
|
## Starting Applet
|
|
33
32
|
|
|
@@ -77,7 +76,7 @@ console.log(sos.config);
|
|
|
77
76
|
## onReady()
|
|
78
77
|
This method will wait until sOS object library and all dependencies are ready to be used.
|
|
79
78
|
|
|
80
|
-
:::
|
|
79
|
+
:::danger
|
|
81
80
|
Every Applet must contain this method, otherwise it won't work.
|
|
82
81
|
:::
|
|
83
82
|
|
|
@@ -102,21 +101,9 @@ window.addEventListener('sos.loaded',() => {
|
|
|
102
101
|
});
|
|
103
102
|
```
|
|
104
103
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<div>
|
|
109
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
110
|
-
<i class="fab fa-github svg-black"></i>
|
|
111
|
-
</div>
|
|
112
|
-
<div>
|
|
113
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Example of Applet for basic start</h3>
|
|
114
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
</a>
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
104
|
+
:::note[GitHub Example]
|
|
105
|
+
[Example of Applet for basic start](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/restore)
|
|
106
|
+
:::
|
|
120
107
|
|
|
121
108
|
## restore()
|
|
122
109
|
The typical case of usage for digital signage is playing a loop with some specified duration. This method should be called always when the loop is changed. It will clear all previously played videos, streams, clear display views, and notify for garbage collection.
|
|
@@ -145,21 +132,9 @@ window.addEventListener('sos.loaded', () => {
|
|
|
145
132
|
});
|
|
146
133
|
```
|
|
147
134
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<div>
|
|
152
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
153
|
-
<i class="fab fa-github svg-black"></i>
|
|
154
|
-
</div>
|
|
155
|
-
<div>
|
|
156
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Example of Applet with restore() method</h3>
|
|
157
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
</a>
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
135
|
+
:::note[GitHub Example]
|
|
136
|
+
[Example of Applet with restore() method](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/restore)
|
|
137
|
+
:::
|
|
163
138
|
|
|
164
139
|
## refresh()
|
|
165
140
|
AFter calling this method applet is freshly launched.
|
|
@@ -192,29 +167,19 @@ window.addEventListener('sos.loaded',() => {
|
|
|
192
167
|
|
|
193
168
|
## Custom variables in Applet
|
|
194
169
|
|
|
195
|
-
You can pass CUSTOM key-value variables to the Applet. To do that, add your values as a Timing configuration (over Box of [Timings API](/
|
|
170
|
+
You can pass CUSTOM key-value variables to the Applet. To do that, add your values as a Timing configuration (over Box of [Timings API](https://docs.signageos.io/hc/en-us/articles/4405238989458)). Then you can access your values via `sos.config` object.
|
|
196
171
|
|
|
197
172
|
```javascript
|
|
198
173
|
// Parsed JSON object passed to Timing for current applet & current device together
|
|
199
174
|
console.log(sos.config.mySecretID);
|
|
200
175
|
console.log(sos.config.imgUrl);
|
|
201
176
|
```
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<i class="fas fa-hand-point-right svg-black"></i>
|
|
209
|
-
</div>
|
|
210
|
-
<div>
|
|
211
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Custom variables in Applet</h3>
|
|
212
|
-
<div class="wide-box__description">How to pass custom variables and cofiguration to your Applet</div>
|
|
213
|
-
</div>
|
|
214
|
-
</div>
|
|
215
|
-
</a>
|
|
216
|
-
</div>
|
|
217
|
-
</div>
|
|
177
|
+
|
|
178
|
+
:::note[Guide]
|
|
179
|
+
[Custom variables in Applet](https://docs.signageos.io/hc/en-us/articles/4405238989458)
|
|
180
|
+
|
|
181
|
+
How to pass custom variables and cofiguration to your Applet
|
|
182
|
+
:::
|
|
218
183
|
|
|
219
184
|
## Applet JS API version
|
|
220
185
|
|
|
@@ -232,14 +197,13 @@ There are two kinds of capabilities - display and management.
|
|
|
232
197
|
|
|
233
198
|
Display capabilities refer to the capabilities of the display in terms of content, playback, peripherals, etc.
|
|
234
199
|
|
|
235
|
-
|
|
200
|
+
|
|
236
201
|
| Capability | Description |
|
|
237
202
|
| ------------------------------ | ----------------------------------------------------------------------------------------- |
|
|
238
|
-
| `FILE_SYSTEM_EXTERNAL_STORAGE` | Device file system supports [external storage](
|
|
239
|
-
| `FILE_SYSTEM_FILE_CHECKSUM` | Device is can [calculate a file checksum](
|
|
240
|
-
| `VIDEO_4K` | Device is capable of [playing 4K video](
|
|
241
|
-
| `SERIAL` | Device supports communication with peripherals over [serial](
|
|
242
|
-
:::
|
|
203
|
+
| `FILE_SYSTEM_EXTERNAL_STORAGE` | Device file system supports [external storage](content/js-file-system) (i.e. flash drives) |
|
|
204
|
+
| `FILE_SYSTEM_FILE_CHECKSUM` | Device is can [calculate a file checksum](content/js-file-system#getfilechecksum) |
|
|
205
|
+
| `VIDEO_4K` | Device is capable of [playing 4K video](content/js-video) |
|
|
206
|
+
| `SERIAL` | Device supports communication with peripherals over [serial](content/js-serial)
|
|
243
207
|
|
|
244
208
|
#### Javascript example:
|
|
245
209
|
|
|
@@ -249,41 +213,28 @@ if (await sos.display.supports('VIDEO_4K')) {
|
|
|
249
213
|
}
|
|
250
214
|
```
|
|
251
215
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
<div>
|
|
256
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
257
|
-
<i class="fab fa-github svg-black"></i>
|
|
258
|
-
</div>
|
|
259
|
-
<div>
|
|
260
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Example of Content Capabilities</h3>
|
|
261
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
262
|
-
</div>
|
|
263
|
-
</div>
|
|
264
|
-
</a>
|
|
265
|
-
</div>
|
|
266
|
-
</div>
|
|
216
|
+
:::note[GitHub Example]
|
|
217
|
+
[Example of Content Capabilities](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/capabilities-content)
|
|
218
|
+
:::
|
|
267
219
|
|
|
268
220
|
|
|
269
221
|
### Management capabilities
|
|
270
222
|
|
|
271
223
|
Management capabilities refer to the capabilities of the display's internal state management.
|
|
272
224
|
|
|
273
|
-
|
|
225
|
+
|
|
274
226
|
| Capability | Description |
|
|
275
227
|
| ------------------------------ | ----------------------------------------------------------------------------------------- |
|
|
276
|
-
| `BATTERY_STATUS` | Device can [report its battery status](
|
|
277
|
-
| `WIFI` | Device can [connect to a Wi-Fi](
|
|
278
|
-
| `WIFI_SCAN` | Device can [scan surrounding Wi-Fi devices](
|
|
279
|
-
| `WIFI_AP` | Device is capable of [becoming a Wi-Fi endpoint](
|
|
280
|
-
| `SET_BRIGHTNESS` | Device can change its [screen brightness](
|
|
281
|
-
| `SET_TIME` | Device can change its [time settings](
|
|
282
|
-
| `NTP_TIME` | Device can [synchronize its time with an NTP server](
|
|
283
|
-
| `PACKAGE_INSTALL` | It's possible to [install additional packages](
|
|
284
|
-
| `SET_VOLUME` | Device can change its [audio volume](
|
|
285
|
-
| `SET_REMOTE_CONTROL_ENABLED` | Device can [disable control via IR remote](
|
|
286
|
-
:::
|
|
228
|
+
| `BATTERY_STATUS` | Device can [report its battery status](management/js-management-management#getbatterystatus). |
|
|
229
|
+
| `WIFI` | Device can [connect to a Wi-Fi](management/js-management-wifi#connect). |
|
|
230
|
+
| `WIFI_SCAN` | Device can [scan surrounding Wi-Fi devices](management/js-management-wifi#scandevices). |
|
|
231
|
+
| `WIFI_AP` | Device is capable of [becoming a Wi-Fi endpoint](management/js-management-wifi#enableap) that other devices can connect to. |
|
|
232
|
+
| `SET_BRIGHTNESS` | Device can change its [screen brightness](management/js-management-screen#setbrightness). |
|
|
233
|
+
| `SET_TIME` | Device can change its [time settings](management/js-management-time). |
|
|
234
|
+
| `NTP_TIME` | Device can [synchronize its time with an NTP server](management/js-management-time#setntp). |
|
|
235
|
+
| `PACKAGE_INSTALL` | It's possible to [install additional packages](management/js-management-package) on the device, managed by signageOS application. |
|
|
236
|
+
| `SET_VOLUME` | Device can change its [audio volume](management/js-management-audio). |
|
|
237
|
+
| `SET_REMOTE_CONTROL_ENABLED` | Device can [disable control via IR remote](management/js-management-remote-control) to increase security.
|
|
287
238
|
|
|
288
239
|
```javascript
|
|
289
240
|
if (await sos.management.supports('WIFI')) {
|
|
@@ -291,18 +242,6 @@ if (await sos.management.supports('WIFI')) {
|
|
|
291
242
|
}
|
|
292
243
|
```
|
|
293
244
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
<div>
|
|
298
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
299
|
-
<i class="fab fa-github svg-black"></i>
|
|
300
|
-
</div>
|
|
301
|
-
<div>
|
|
302
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Example of Management Capabilities</h3>
|
|
303
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
304
|
-
</div>
|
|
305
|
-
</div>
|
|
306
|
-
</a>
|
|
307
|
-
</div>
|
|
308
|
-
</div>
|
|
245
|
+
:::note[GitHub Example]
|
|
246
|
+
[Example of Management Capabilities](https://github.com/signageos/applet-examples/blob/master/examples/management-js-api/capabilities-management)
|
|
247
|
+
:::
|
|
@@ -16,20 +16,16 @@ description: "[Content JS API] Often there are some JavaScripts and CSS styles n
|
|
|
16
16
|
Often there are some JavaScripts and CSS styles necessary to be loaded for your Applet.
|
|
17
17
|
It can be libraries like jQuery or even your whole application code. For these necessities offline API for saving, storing & loading files are ready.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
## All methods
|
|
21
|
-
::: table-responsive
|
|
22
19
|
| Methods | Description | Supported since |
|
|
23
|
-
| ------- | ----------- | ------ |
|
|
20
|
+
| ------- | ----------- | ------ |
|
|
24
21
|
| `addFile()` | Add single file to Applet before starting it. | 1.0.0 |
|
|
25
22
|
| `addFiles()` | Add files to Applet before starting it. | 1.0.0 |
|
|
26
|
-
| `addFilesSync()` | Add files to Applet before starting it in the set order to prevent race condition. | 1.0.0
|
|
27
|
-
:::
|
|
23
|
+
| `addFilesSync()` | Add files to Applet before starting it in the set order to prevent race condition. | 1.0.0
|
|
28
24
|
|
|
29
25
|
### File object
|
|
30
26
|
Every method above, accept single object or array of objects depending by type. Every object **must have** these keys.
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
|
|
33
29
|
| Key | Type | Required | Description |
|
|
34
30
|
| :-----: | :-----: | :----: | ------- |
|
|
35
31
|
| `uri` | String | <div class="red">Yes</div> | URL of file |
|
|
@@ -37,10 +33,9 @@ Every method above, accept single object or array of objects depending by type.
|
|
|
37
33
|
| `type` | String | <div class="red">Yes</div> | Type of file. Example: `sos.offline.types.javascript`, `sos.offline.types.css`, `sos.offline.types.video` |
|
|
38
34
|
|||| ^^ |
|
|
39
35
|
| `flags` | Array | <div class="red">Yes</div> | Special flag for file |
|
|
40
|
-
| `headers` | Array | <div class="yellow">No</div> | Authorization headers
|
|
41
|
-
:::
|
|
36
|
+
| `headers` | Array | <div class="yellow">No</div> | Authorization headers
|
|
42
37
|
|
|
43
|
-
:::
|
|
38
|
+
:::info
|
|
44
39
|
* The file URL must point to a file. If your URI leads to a 303 redirect (e.g. from http to http**s**), the API will not work.
|
|
45
40
|
* There are some limitations for [Emulator](https://docs.signageos.io/hc/en-us/articles/4405238997138).
|
|
46
41
|
:::
|
|
@@ -84,21 +79,9 @@ const files = [ // Array of files
|
|
|
84
79
|
await sos.offline.addFiles(files);
|
|
85
80
|
```
|
|
86
81
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<div>
|
|
91
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
92
|
-
<i class="fab fa-github svg-black"></i>
|
|
93
|
-
</div>
|
|
94
|
-
<div>
|
|
95
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Example of Applet that save files and load them in one file</h3>
|
|
96
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
</a>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
82
|
+
:::note[GitHub Example]
|
|
83
|
+
[Example of Applet that save files and load them in one file](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/offline-resources)
|
|
84
|
+
:::
|
|
102
85
|
|
|
103
86
|
## addFilesSync()
|
|
104
87
|
Method `addFilesSync()` works same as method above, but all files are loaded in correct order. Otherwise, files are loaded in random order by file size.
|
|
@@ -156,7 +139,7 @@ interface IFlag {
|
|
|
156
139
|
## Errors
|
|
157
140
|
Although we are doing our best, following errors may occur when working with the Applet Resources.
|
|
158
141
|
|
|
159
|
-
|
|
142
|
+
|
|
160
143
|
| Code | Type | Message |
|
|
161
144
|
| ---- | ---- | ------- |
|
|
162
145
|
| 40101 | AppletResourcesError | File needs to be object |
|
|
@@ -168,5 +151,4 @@ Although we are doing our best, following errors may occur when working with the
|
|
|
168
151
|
| 40106 | AppletResourcesError | Already existing file: `FILE_NAME` |
|
|
169
152
|
|^^|^^| File is already loaded or exists in Applet |
|
|
170
153
|
| 49901 | FileNotFoundError | File `FILE_ID` was not found |
|
|
171
|
-
|^^|^^| Applet can not get file. URL is invalid.
|
|
172
|
-
:::
|
|
154
|
+
|^^|^^| Applet can not get file. URL is invalid.
|
|
@@ -13,25 +13,24 @@ description: "[Content JS API] There are several use-cases when you need to open
|
|
|
13
13
|
|
|
14
14
|
# Browser
|
|
15
15
|
|
|
16
|
-
There are several use-cases when you need to open a web browser on a touch-enabled device (also known as a tablet).
|
|
17
|
-
For these cases, you can use a custom web browser we built.
|
|
18
|
-
Default URL can be opened and even the whitelisting/blacklisting of certain domains is supported.
|
|
16
|
+
There are several use-cases when you need to open a web browser on a touch-enabled device (also known as a tablet).
|
|
17
|
+
For these cases, you can use a custom web browser we built.
|
|
18
|
+
Default URL can be opened and even the whitelisting/blacklisting of certain domains is supported.
|
|
19
19
|
|
|
20
20
|
## All methods
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
| Methods | Description | Supported since |
|
|
23
|
-
| ----------------- | ----------- |
|
|
23
|
+
| ----------------- | ----------- | :---------------: |
|
|
24
24
|
| `open()` | Open page in integrated browser | 4.0.0 |
|
|
25
|
-
| `close()` | Open page in integrated browser | 4.4.0
|
|
26
|
-
:::
|
|
25
|
+
| `close()` | Open page in integrated browser | 4.4.0
|
|
27
26
|
|
|
28
27
|
## open()
|
|
29
28
|
|
|
30
|
-
:::
|
|
31
|
-
**This API is currently available on:**
|
|
29
|
+
:::info
|
|
30
|
+
**This API is currently available on:**
|
|
32
31
|
- Android devices with Android 5+ (Philips, Benq, Sharp, generic Android device)
|
|
33
32
|
|
|
34
|
-
**With some limitation you can use this API also on**
|
|
33
|
+
**With some limitation you can use this API also on**
|
|
35
34
|
- Samsung Tizen (SSSP 4 and above); where the website is just in fullscreen without an address bar or theme options (headless mode)
|
|
36
35
|
- LG webOS (webOS 3.0 and above); where the website is just in fullscreen without an address bar or theme options (headless mode)
|
|
37
36
|
- Raspberry Pi and NEC Compute Module; where the website is just in fullscreen without an address bar or theme options (headless mode)
|
|
@@ -42,22 +41,23 @@ Simple opening some page ex. our main company page.
|
|
|
42
41
|
```javascript
|
|
43
42
|
sos.browser.open('https://www.signageos.io'); // Open link in the browser
|
|
44
43
|
```
|
|
45
|
-
<br
|
|
44
|
+
<br/>
|
|
46
45
|
|
|
47
46
|
Method `open()` also supports properties for browser. You can set height, width or CORS domains. All properties are optional.
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
|
|
50
49
|
| Property | Type | Description |
|
|
51
50
|
| -------- | ------ | -------- |
|
|
52
51
|
| `aclDomains` | Array | ? |
|
|
53
52
|
| `aclMode` | String | Can be only **blacklist** or **whitelist**. |
|
|
54
53
|
| `readOnlyAddressBar` | Boolean | Accessible address bar |
|
|
55
|
-
| `coordinates` | Object | Size of browser screen (only
|
|
54
|
+
| `coordinates` | Object | Size of browser screen (only Linux) |
|
|
56
55
|
| `idleTimeout` | Number | Timeout in milliseconds for loading page |
|
|
57
56
|
| `theme` | Object | Setting custom theme for Android |
|
|
58
57
|
| `headlessMode` | Boolean | Headless mode hides the entire address bar (default) |
|
|
59
|
-
| `canUserClose` | Boolean | Whether the user can manually close the browser. Default:<br
|
|
60
|
-
| `clearData` | Boolean | Clear cache after the browser closes. Default:<br
|
|
58
|
+
| `canUserClose` | Boolean | Whether the user can manually close the browser. Default:<br/>**Headless:** `false`<br/>**With UI:** `true` |
|
|
59
|
+
| `clearData` | Boolean | Clear cache after the browser closes. Default:<br/>**Headless:** `false`<br/>**With UI:** `true`
|
|
60
|
+
| `method` | String | Can only be **native** (which opens a new, fully sandboxed fullscreen window) or **iframe** (which opens a configurable-sized window). (only Linux) |
|
|
61
61
|
:::
|
|
62
62
|
|
|
63
63
|
|
|
@@ -66,7 +66,7 @@ sos.browser.open('https://www.signageos.io', {
|
|
|
66
66
|
aclDomains: ['google.com', 'yahoo.com'],
|
|
67
67
|
aclMode: 'blacklist', // or 'whitelist'
|
|
68
68
|
readOnlyAddressBar: true,
|
|
69
|
-
coordinates: { // Supported only on
|
|
69
|
+
coordinates: { // Supported only on Linux and Android
|
|
70
70
|
x: 0,
|
|
71
71
|
y: 0,
|
|
72
72
|
height: 500,
|
|
@@ -76,26 +76,14 @@ sos.browser.open('https://www.signageos.io', {
|
|
|
76
76
|
headlessMode: false, // supported only on Android
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<div>
|
|
83
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
84
|
-
<i class="fab fa-github svg-black"></i>
|
|
85
|
-
</div>
|
|
86
|
-
<div>
|
|
87
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Example of Applet for using browser on Android</h3>
|
|
88
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</a>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
79
|
+
:::note[GitHub Example]
|
|
80
|
+
[Example of Applet for using browser on Android](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/browser)
|
|
81
|
+
:::
|
|
94
82
|
|
|
95
83
|
### Browser themes usage with Typescript
|
|
96
84
|
You can also use all these methods with [signageOS TypeScript](https://docs.signageos.io/hc/en-us/articles/4405069154962#signageos-typescript).
|
|
97
85
|
|
|
98
|
-
:::
|
|
86
|
+
:::info
|
|
99
87
|
Browser themes are only available on Android devices.
|
|
100
88
|
:::
|
|
101
89
|
|
|
@@ -148,6 +136,7 @@ interface IOpenLinkOptions {
|
|
|
148
136
|
headlessMode?: boolean;
|
|
149
137
|
clearData?: boolean;
|
|
150
138
|
canUserClose?: boolean;
|
|
139
|
+
method?: 'native' | 'iframe'
|
|
151
140
|
}
|
|
152
141
|
|
|
153
142
|
open(uri: string, options?: IOpenLinkOptions): void;
|
|
@@ -162,15 +151,14 @@ Simple opening some page ex. our main company page.
|
|
|
162
151
|
```javascript
|
|
163
152
|
sos.browser.close(); // Close the browser
|
|
164
153
|
```
|
|
165
|
-
<br
|
|
154
|
+
<br/>
|
|
166
155
|
|
|
167
156
|
## Errors
|
|
168
157
|
Although we are doing our best, following errors may occur when opening a link.
|
|
169
158
|
|
|
170
|
-
|
|
159
|
+
|
|
171
160
|
| Code | Type | Message |
|
|
172
161
|
| ---- | ---- | ------- |
|
|
173
162
|
| 40301 | AppletBrowserUriError | Property argument `uri` must be a string |
|
|
174
|
-
| 50301 | InternalBrowserOpenLinkError | Unexpected error occurred when opening `$$LINK$$`
|
|
175
|
-
:::
|
|
163
|
+
| 50301 | InternalBrowserOpenLinkError | Unexpected error occurred when opening `$$LINK$$`
|
|
176
164
|
|
|
@@ -18,25 +18,22 @@ In some cases, you might be interested in a complete log of what the device was
|
|
|
18
18
|
All commands will be available in [Applet Command REST API](https://api.docs.signageos.io/#8e7a8814-e612-1fad-0152-72f37591c7f2) and can be downloaded [historically as CSV export](https://api.docs.signageos.io/#5dceec58-ac4f-7a0c-f5ef-0854f9376e6d).
|
|
19
19
|
|
|
20
20
|
## All methods
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
| Methods | Description | Supported since |
|
|
23
23
|
| ----------------- | ----------- | ----- |
|
|
24
24
|
| `dispatch()` | Dispatch method for sending logs and data from device | 1.0.3 |
|
|
25
25
|
| `onCommand()` | Event listener for incoming commands from server | 1.0.3 |
|
|
26
26
|
|
|
27
|
-
:::
|
|
28
|
-
|
|
29
27
|
## dispatch()
|
|
30
28
|
|
|
31
29
|
Dispatch() is used for sending your custom logs or data from device to signageOS.
|
|
32
30
|
|
|
33
31
|
### Parameters
|
|
34
|
-
|
|
32
|
+
|
|
35
33
|
| Parameter | Type | Required | Description |
|
|
36
34
|
| -------------- | -------------| :----------------: | ------------- |
|
|
37
35
|
| `type` | String | <div class="red">Yes</div> | Event type; can be any string **up to 100 characters**|
|
|
38
|
-
| custom `parameter` | String | No | Custom parameters and values that you need to be dispatched
|
|
39
|
-
:::
|
|
36
|
+
| custom `parameter` | String | No | Custom parameters and values that you need to be dispatched
|
|
40
37
|
|
|
41
38
|
### Javascript example
|
|
42
39
|
```javascript
|
|
@@ -70,30 +67,17 @@ await sos.command.dispatch({
|
|
|
70
67
|
|
|
71
68
|
```
|
|
72
69
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<div>
|
|
77
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
78
|
-
<i class="fab fa-github svg-black"></i>
|
|
79
|
-
</div>
|
|
80
|
-
<div>
|
|
81
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Sending commands</h3>
|
|
82
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</a>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
70
|
+
:::note[GitHub Example]
|
|
71
|
+
[Sending commands](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/command/sending/)
|
|
72
|
+
:::
|
|
88
73
|
|
|
89
74
|
### Errors
|
|
90
|
-
|
|
75
|
+
|
|
91
76
|
| Code | Type | Message |
|
|
92
77
|
| ---- | ---- | ------- |
|
|
93
78
|
| 40401 | AppletCommandTypeError | Type contains invalid characters. |
|
|
94
79
|
| 40402 | AppletCommandTypeError | Type is longer then 100 characters. |
|
|
95
|
-
| 40403 | AppletCommandTypeError | Command type must be a string.
|
|
96
|
-
:::
|
|
80
|
+
| 40403 | AppletCommandTypeError | Command type must be a string.
|
|
97
81
|
|
|
98
82
|
|
|
99
83
|
### Usage with Typescript
|
|
@@ -104,37 +88,19 @@ interface ICommand {
|
|
|
104
88
|
dispatch(command: ICommand): void;
|
|
105
89
|
```
|
|
106
90
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
</div>
|
|
121
|
-
</div>
|
|
122
|
-
|
|
123
|
-
<div class="row d-flex align-content-stretch force-padding-20">
|
|
124
|
-
<div class="col-12 d-flex">
|
|
125
|
-
<a class="wide-box wide-box--white d-flex align-content-stretch widebox-kb-color" href="https://api.docs.signageos.io/#5dceec58-ac4f-7a0c-f5ef-0854f9376e6d">
|
|
126
|
-
<div>
|
|
127
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
128
|
-
<i class="fas fa-server svg-black"></i>
|
|
129
|
-
</div>
|
|
130
|
-
<div>
|
|
131
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Rest API: Monitoring/Device Reports</h3>
|
|
132
|
-
<div class="wide-box__description">Receiving historical data</div>
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
</a>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
91
|
+
:::note[GitHub Example]
|
|
92
|
+
[Rest API: Get Commands](https://api.docs.signageos.io/#8e7a8814-e612-1fad-0152-72f37591c7f2)
|
|
93
|
+
|
|
94
|
+
Receiving your data dispatched from devices
|
|
95
|
+
|
|
96
|
+
:::
|
|
97
|
+
|
|
98
|
+
:::note[GitHub Example]
|
|
99
|
+
[Rest API: Monitoring/Device Reports](https://api.docs.signageos.io/#5dceec58-ac4f-7a0c-f5ef-0854f9376e6d)
|
|
100
|
+
|
|
101
|
+
Receiving historical data
|
|
102
|
+
|
|
103
|
+
:::
|
|
138
104
|
|
|
139
105
|
## onCommand()
|
|
140
106
|
Used for sending custom messages to online connected devices.
|
|
@@ -142,12 +108,11 @@ This can be done through the REST API by [POST new applet command](https://api.d
|
|
|
142
108
|
The command will be dispatched to the device & the applet can set up the logic by subscribing `onCommand` method.
|
|
143
109
|
|
|
144
110
|
**Parameters:**
|
|
145
|
-
|
|
111
|
+
|
|
146
112
|
| Param | Type | Required | Description |
|
|
147
113
|
| -------------- | ---------- | :-------: | ---------------------- |
|
|
148
114
|
| `command` | object | <div class="red">Yes</div> | Any JS object with required property type. |
|
|
149
|
-
| `append` | HTMLElement | <div class="red">Yes</div> | Type property must be string not longer then 50 characters and must contain only characters a-zA-Z0-9_- and .
|
|
150
|
-
:::
|
|
115
|
+
| `append` | HTMLElement | <div class="red">Yes</div> | Type property must be string not longer then 50 characters and must contain only characters a-zA-Z0-9_- and .
|
|
151
116
|
|
|
152
117
|
### Javascript
|
|
153
118
|
```javascript
|
|
@@ -156,21 +121,9 @@ sos.command.onCommand((command) => {
|
|
|
156
121
|
});
|
|
157
122
|
```
|
|
158
123
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
<div>
|
|
163
|
-
<div class="wide-box__image d-flex align-items-center">
|
|
164
|
-
<i class="fab fa-github svg-black"></i>
|
|
165
|
-
</div>
|
|
166
|
-
<div>
|
|
167
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Receiving commands</h3>
|
|
168
|
-
<div class="wide-box__description">Working example on our Github</div>
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
171
|
-
</a>
|
|
172
|
-
</div>
|
|
173
|
-
</div>
|
|
124
|
+
:::note[GitHub Example]
|
|
125
|
+
[Receiving commands](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/command/receiving)
|
|
126
|
+
:::
|
|
174
127
|
|
|
175
128
|
### Usage with Typescript
|
|
176
129
|
```typescript
|
|
@@ -180,29 +133,18 @@ interface ICommand {
|
|
|
180
133
|
onCommand(listener: (command: ICommand) => void): void;
|
|
181
134
|
```
|
|
182
135
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
<i class="fas fa-server svg-black"></i>
|
|
189
|
-
</div>
|
|
190
|
-
<div>
|
|
191
|
-
<h3 class="wide-box__title wide-box__title__small pl-85">Rest API: Monitoring</h3>
|
|
192
|
-
<div class="wide-box__description">Creating monitoring data</div>
|
|
193
|
-
</div>
|
|
194
|
-
</div>
|
|
195
|
-
</a>
|
|
196
|
-
</div>
|
|
197
|
-
</div>
|
|
136
|
+
:::note[GitHub Example]
|
|
137
|
+
[Rest API: Monitoring](https://api.docs.signageos.io/#511e18f3-b61b-a049-6395-8541132adc44)
|
|
138
|
+
|
|
139
|
+
Creating monitoring data
|
|
140
|
+
:::
|
|
198
141
|
|
|
199
142
|
## Errors
|
|
200
143
|
Although we are doing our best, following errors may occur when working with the commands.
|
|
201
144
|
|
|
202
|
-
|
|
145
|
+
|
|
203
146
|
| Code | Type | Message |
|
|
204
147
|
| ---- | ---- | ------- |
|
|
205
148
|
| 40401 | AppletCommandTypeError | Type contains invalid characters, allowed are `/^[a-zA-Z0-9\.\-_]+$/g`|
|
|
206
149
|
| 40402 | AppletCommandTypeError | Type is longer then 100 characters. |
|
|
207
|
-
| 40403 | AppletCommandTypeError | Command type must be a string.
|
|
208
|
-
:::
|
|
150
|
+
| 40403 | AppletCommandTypeError | Command type must be a string.
|
|
@@ -16,12 +16,11 @@ JS API debug lets you information about remote debug mode.
|
|
|
16
16
|
|
|
17
17
|
## All methods
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
| Method | Description | Supported since |
|
|
21
21
|
| ------ | -------- | :-------------: |
|
|
22
22
|
| `isRemoteDebugEnabled()` | Returns information about remote debug settings | 5.8 |
|
|
23
|
-
| `onRemoteDebugChanged()` | Accept function which is called after remote debug settings is changed | 5.8
|
|
24
|
-
:::
|
|
23
|
+
| `onRemoteDebugChanged()` | Accept function which is called after remote debug settings is changed | 5.8
|
|
25
24
|
|
|
26
25
|
## isRemoteDebugEnabled()
|
|
27
26
|
Method `isRemoteDebugEnabled()` returns the state of the [Device debug](https://docs.signageos.io/hc/en-us/articles/4416366711442-Device-debug) (**true** or **false**).
|
|
@@ -8,20 +8,19 @@ tags:
|
|
|
8
8
|
- applet_api
|
|
9
9
|
- api
|
|
10
10
|
- js_api
|
|
11
|
-
description: "
|
|
11
|
+
description: "Information set to the device using the CloudControl - e.g. Location and Tags."
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
# Device Info
|
|
15
|
-
|
|
15
|
+
Information set to the device using the CloudControl - e.g. Location and Tags.
|
|
16
16
|
|
|
17
17
|
## All methods
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
| Method | Description | Supported since |
|
|
21
21
|
| ----------------- | ------------------ | :---------------: |
|
|
22
22
|
| `getLocation()` | Returns location when assigned to device | 5.2.0 |
|
|
23
|
-
| `getOrganizationTags()` | Returns list of organization tags when some assigned to device | 5.2.0
|
|
24
|
-
:::
|
|
23
|
+
| `getOrganizationTags()` | Returns list of organization tags when some assigned to device | 5.2.0
|
|
25
24
|
|
|
26
25
|
## getLocation()
|
|
27
26
|
Location is requested from server on application start, automatically updated when changed and persists in local storage.
|