advace interface doesn't work on android
i-jw opened this issue · 1 comments
i use nativescript-websocket 1.5.0 only Browser based Interface can open
when I use Advanced Interface to create Websocket like this :
this.mySocket = new WebSocket(url, {timeout: 6000}); this.mySocket.open();
the error log as below
app/pages/items.component.ts(142,21): error TS2551: Property 'open' does not exist on type 'WebSocket'. Did you mean 'OPEN'? app/pages/items.component.ts(655,41): error TS2345: Argument of type '{ timeout: number; }' is not assignable to parameter of type 'string | string[]'. Object literal may only specify known properties, and 'timeout' does not exist in type 'string | string[]'.
which version support the advace interface
Yeah, that doesn't work. You have to do:
const WS = require('@master.technology/websockets'); then use WS
to create a new websocket. If you attempt to use the default un-scoped/global "WebSocket" this is the browser version