react-native-mqtt
react-native-mqtt copied to clipboard
Mqtt client for react native.
代码: import { AsyncStorage }from'react-native'; import init from 'react_native_mqtt'; init({ size: 10000, storageBackend: AsyncStorage, defaultExpires: 1000 * 3600 * 24, enableCache: true, reconnect: true, sync: {} }); //第一步:创建 // 地址,端口,路径(这么写就行了),connectId(随便写)...
All connection timeout: const client = new Paho.MQTT.Client('iot.eclipse.org',80, 'aaa'); //const client = new Paho.MQTT.Client('mqtt.swifitch.cz',1883, 'aaa'); client.onConnectionLost = this.onConnectionLost; client.onMessageArrived = this.onMessageArrived; client.connect({ onSuccess: this.onConnect,onFailure:this.onFailure }); "react": "16.0.0", "react-native": "0.51.0", "react_native_mqtt":...
I instaled AsyncStorage with yarn add @react-native-async-storage/async-storage and and passed the object to init. But when compiles I get the error: AMQJS0010E localStorage is not supported by this browser. Line...
Are you likely to change this from [https://raw.githubusercontent.com/eclipse/paho.mqtt.javascript/master/src/mqttws31.js] to (https://raw.githubusercontent.com/eclipse/paho.mqtt.javascript/master/src/paho-mqtt.js). as this seems to resolve the MALFORMED UTF disconnections.
I've been trying to use react_native_mqtt to handle a feature that required mqtt connection still alive when app in background mode. But after 1 or 2 minute in background, mqtt...
I have tried including this in my project in expo but I just can't get it to work, I have tried it with cloudmqtt, hive and eclipse online free brokers...
The package works perfectly on iOS. However, when I run on Android, with the exact same parameters and code, I get this (AMQJS0007E Socket error:undefined). Any solutions?
I tried running the example. Steps: 1. git clone https://github.com/AnxiousDarkly/react-native-mqtt.git 2. cd react-native-mqtt/example 3. yarn install 4. react-native run-android Check mobile android error attached image https://prnt.sc/yoe3go
how can we use the ssl certificate client to authorize connection between server and client? I just seeing the parameter useSSL: true/false but the client need a certificate ? like...
I have configure my broker with SSL like this in mosquitto.conf listener 8883 protocol mqtt cafile /usr/local/etc/mosquitto/certs2/ca.crt keyfile /usr/local/etc/mosquitto/certs2/server.key certfile /usr/local/etc/mosquitto/certs2/server.crt listener 443 protocol websockets cafile /usr/local/etc/mosquitto/certs/ca.crt keyfile /usr/local/etc/mosquitto/certs/server.key certfile...