Introvertuous/react-native-mqtt

AMQJS0016E Invalid MQTT message type 0.

ngocdb opened this issue · 3 comments

I am using your module in my react native projects. In one app, everything is ok on the emulator. But in another app, I always get the error "AMQJS0016E Invalid MQTT message type 0." on the emulator.

Object {invocationContext: undefined, errorCode: 16, errorMessage: "AMQJS0016E Invalid MQTT message type 0."}

I can say the Mqtt codes are very similar if not same between 2 apps.

So how can I debug the issue, please help.
P/S: not sure if it comes from AsyncStorage ?, your module will use different key for different apps in AsyncStorage ?, or how you build it currently ?

Actually, the one is working on a older version of react native:
"react": "~15.4.0-rc.4",
"react-native": "0.40.0",
"react-native-elements": "^0.9.2",
"react-native-storage": "^0.1.4",
"react-native-vector-icons": "^4.0.0",
"react_native_mqtt": "^1.1.4"
And it seems doesn't work any more with new versions:
"react": "16.0.0-alpha.12",
"react-native": "0.46.4",
"react-native-elements": "^0.15.0",
"react-native-storage": "^0.2.2",
"react-native-vector-icons": "^4.2.0",
"react_native_mqtt": "^1.1.6"
Of course if you have any suggestion, please tell me...

I tested up to the 0.45.0 version

...
"react": "16.0.0-alpha.12",
"react-native": "0.45.0",
...

and it still runs well.

But it fails with the 0.46.4 version. Check the release notes, I see there is a change with websocket in the latest version.

Added Cookie Header to XML and Websocket request (047961f)

Not sure how this thing affect the mqtt connect ?

Apologies in advance for the delay in response.

I am not able to reproduce this error in the current version of react native (v0.48.1).
I added a runnable example with instructions today.

Please feel free to re-open if this is still an issue.