Introvertuous / react-native-mqtt

Mqtt client for react native.
MIT License
158 stars 30 forks source link

MQTT connection lost when app is in background for above 1 or 2 minutes (Android) #31

Open letrinhthanhvn opened 3 years ago

letrinhthanhvn commented 3 years ago

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 connection lost and console: {errorCode: 7, errorMessage: 'AMQJS0007E Socket error:undefined.', reconnect: false, uri: 'ws://..*.*:/mqtt'}. Is this a bug of library or related to Android OS? And if anyone faced this problem before, please explain it. Thanks a lot! My library information i'm using: