iospush-notificationmqttios-mqtt-client-framework

MQTT-Client-Framework stay running at background


I'm trying to connect to our push server via MQTT-Client-Framework.

There is no complication for connecting to server and with a few line of code i can connect to server and subscribe to topic.

but I have a few question that I could not find any direct answer for them.

1) How can I keep my client running at background?

2) What happen after device restart? how can I automatically connect to server after device restart?

3)Suppose I got an error during connecting to server. Will this library trying to connect in a loop? how many times it try? or I need to manage this myself?

4) The same 3 scenario for subscribing to topic?


Solution

  • Based on my experience on MQTT-client framework following are the answers to your questions/queries. I hope it clarifies your concerns and helps you to move ahead.

    1) How can I keep my client running at background?

    2) What happen after device restart? how can I automatically connect to server after device restart?

    3) Suppose I got an error during connecting to server. Will this library trying to connect in a loop? how many times it try? or I need to manage this myself?

    4) The same 3 scenario for subscribing to topic?

    Happy coding :)