tabris-js
tabris-js copied to clipboard
Error after integrating mqtt.js with tabris.js
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
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
cordova-plugin-mqtt i have not tried it too.
websocket is ok, but I want to integrate mqtt