Open jahnli opened 3 years ago
@jahnli Check here https://github.com/anoop4real/Flutter_mqtt_new this uses a shared manager.
The current situation is that I subscribed to one topic on page A and wrote an MqttClientTopicFilter updates. Listen. When I destroyed page A, I cancelled the subscription and re-subscribed to the topic when I entered page A again ,This resulted in repeated messages being returned multiple times in update.listen
If multiple pages have multiple topics, updates. Listen needs to be written several times
@jahnli Please check here https://github.com/anoop4real/Flutter_mqtt_new this issue is fixed https://github.com/anoop4real/Flutter_mqtt_new/issues/1
Also if you have multiple topics subscribed, just filter those by topic from payload, hope it helps
I met the same problem, but I didn't find the specific code to solve this problem. Could you please intercept or tell me which one it is
@jahnli Mostly it was because the usecase in this project was basic, the main issue was that I was not handling the subcribe call properly. The idea is make sure the mqttClient listen only once and subscription can happen multiple times
Ok, thanks for your advice
If multiple subscriptions are required, updates. Listen should be set in mqttManager or separately on each page