tabris-js icon indicating copy to clipboard operation
tabris-js copied to clipboard

Error after integrating mqtt.js with tabris.js

Open ilegoo88 opened this issue 2 years ago • 3 comments

const options = { clean: true, connectTimeout: 4000, protocolVersion: 5, clientId: web_${Math.random().toString(16).slice(3)}, username: '', password: '' }; const connectUrl = 'ws://192.168.2.160:8083/mqtt'; const client = mqtt.connect(connectUrl, options); client.on("connect", function (connack) { if(!client.connected) return; console.log('ok.') });

connect ok, Developer App error quit

ilegoo88 avatar Jul 25 '23 01:07 ilegoo88

mqtt relies on several native node modules (like fs or path) that are not supported:

It is also compatible with many JavaScript libraries that do not require the DOM or native node modules.

There's also cordova-plugin-mqtt. I have not tried it

cookieguru avatar Jul 25 '23 04:07 cookieguru

cordova-plugin-mqtt i have not tried it too.

ilegoo88 avatar Jul 25 '23 07:07 ilegoo88

websocket is ok, but I want to integrate mqtt

ilegoo88 avatar Jul 25 '23 07:07 ilegoo88