Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mqtt client auto disconnect when off screen #168

Closed
Marcus-Ospicon opened this issue Apr 8, 2020 · 1 comment
Closed

Mqtt client auto disconnect when off screen #168

Marcus-Ospicon opened this issue Apr 8, 2020 · 1 comment

Comments

@Marcus-Ospicon
Copy link

Hi everyone,

I am using the mqtt_client version 6.0.0 in my app, everything works well but when I off the screen (press power button or don't touch for a while) then it didn't work anymore. The log from MQTT broker at this issue is "timeout no response exceed", it seems to be no response that the broker sent a "keep-alive" packet so that my app was being hang at that time. In addition, the issue only occurred when I run in the actual cellphone (Android 7.0, API_24), not with an emulator. So now, I want to do one of 2 option below:

1. Always keeping the app run even screen power off
2. When turning on the screen back and access to the app, the connection auto-connect and having a callback let me know to update missing data during disconnected

Which should I do and how can I do?
Thanks a lot and please feel free if any question to clearer about this issue

@shamblett
Copy link
Owner

Can't help you with point 1, this is a flutter/android issue nothing to do with the client itself, version 6.2.0 of the client now has an auto reconnect mechanism, refer to issue 90 and the API docs for usage instructions. Please raise any issues you may have with any of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants