-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
37 lines (29 loc) · 771 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import './shared/device-polyfill'
import { MessageBuilder } from './shared/message'
const logger = DeviceRuntimeCore.HmLogger.getLogger('homeconnect')
const appDevicePort = 20
const appSidePort = 0
const appId = 101233
const messageBuilder = new MessageBuilder({ appId, appDevicePort, appSidePort })
App({
globalData: {
messageBuilder: messageBuilder,
},
onCreate(options) {
logger.log('app onCreate invoked')
messageBuilder.connect()
},
onShow(options) {
logger.log('app onShow invoked')
},
onHide(options) {
logger.log('app onHide invoked')
},
onDestroy(options) {
logger.log('app onDestroy invoked')
messageBuilder.disConnect()
},
onError(error) {},
onPageNotFound(obj) {},
onUnhandledRejection(obj) {},
})