Possible duplicate:
How to keep iphone ios xmpp connection in background?
I use Xmpp in a chat application to send and receive messages. When the iphone goes into the background, my openfire server automatically makes my session offline. After my application wakes up, my session becomes Online in openfire and I can send and receive messages.
Probelm occurs when the iphone is idle for more than 10 minutes or so. Now that the application comes to the fore, I am not getting a list in active sessions on the openfire server. Therefore, I cannot perform chat operations.
After reading a few discussions from the net, I came to this timeout issue. This is due to a timeout. If so, will it work on the following?
File Name: XMPPStream.h
@property (nonatomic, readwrite, assign) NSTimeInterval keepAliveInterval;
Searching for a file with the keyword "DEFAULT_KEEPALIVE_INTERVAL" brought me here ...
#if TARGET_OS_IPHONE
#define DEFAULT_KEEPALIVE_INTERVAL 120.0
#else
#define DEFAULT_KEEPALIVE_INTERVAL 300.0
#endif
Can someone suggest me a working solution? thank
source
share