How to manage connection when enter deep sleep in android using Smack 4.1.4?

Hi Guys,

Currently, I’m developing an Instant Messaging app in Android using Smack 4.1.4. I stuck in a problem that my app can’t receive message when my android device entering deep sleep. I have using PingManager and set the interval in 5 minutes and in my implementation of PingFailedListener, I try to reconnect on its pingFailed method. In addition, I also using ServerPingWithAlarmManager in my service that hold XMPPConnection object. Nevertheless, that’s all not solve my issue, after 10 minutes from my last message(in deep sleep), my app can’t receive the new message. I try to looking for the solution from Project MAXS in transport-xmpp, but I still didn’t get the solution.

Anyone has the same issue? and How do you solve this issue?

Please, help me.

Thank you.

2 Likes

met the same problem