iGenius-Srl / android-mqtt-service

MQTT service for Android
Apache License 2.0
42 stars 24 forks source link

Allow reconnect without enforcing a clean session #6

Open krombel opened 7 years ago

krombel commented 7 years ago

It would be nice to allow "unclean" sessions. This is useful for e.g. push services where the client should receive pushes that were send while the client had connection problems.

I think the change has to be done here (and upwards to make in configurable)

gotev commented 7 years ago

Feel free to fork the project and send a pull request with the change. The easiest way to achieve that is to add:

public static int CLEAN_SESSION = true; //measured in seconds

in MQTTService and set the value in the line you mentioned, so you can make that setting early in the app initialization.