arcoirislabs / cordova-plugin-mqtt

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

Subscribe to multiple topics. #36

Open JakubWedrowycz opened 6 years ago

JakubWedrowycz commented 6 years ago

Hi all. I've just downloaded your plugin and wanted to sy that it's working nicely and is quite well documented. There is however a missing information in the examples. Can somebody provide en example how to subscribe to multiple topics at the same time in one broker? I hope it is possible to subscribe to two topics simultaneously (i.e. without a need to unscubscribe from first and then subscribing to second). Thanks!

arcoirislabs commented 6 years ago

Thank you for your appreciation. If you see a pattern in your topics, you can use (# and + operators). In topic routers you can also add variables to selectively add switch case on specific terms. Otherwise you can do forEach on a topic strings array.

Sent from my iPhone

On 16-Dec-2017, at 6:18 PM, JakubWedrowycz notifications@github.com wrote:

Hi all. I've just downloaded your plugin and wanted to sy that it's working nicely and is quite well documented. There is however a missing information in the examples. Can somebody provide en example how to subscribe to multiple topics at the same time in one broker? I hope it is possible to subscribe to two topics simultaneously (i.e. without a need to unscubscribe from first and then subscribing to second). Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.