arcoirislabs / cordova-plugin-mqtt

MqTT Cordova Plugin for Apache Cordova (> v3.0)
MIT License
86 stars 49 forks source link

Stop Listen (Un-Listen) to a topic without disconnect #38

Open JoshBenaya opened 6 years ago

JoshBenaya commented 6 years ago

Hello all,

I want to ask about: how to stop Listen (Un-Listen) to a topic without disconnecting from the server?

I've tried to Unsubscribe the topic, but the 'Listen' function is not destroyed, so when I Subscribe to the same topic again, I have two 'Listen' function listening to the same topic and when a message published into that topic, I got two message from that topic. What I need is: I can stop the 'Listen' function when i Unsubscribe the topic, and Listen again when i Subscribe the topic.

Thank you!