There are multiple cases here and I would like to highlight them separately.
User presses home button -> app goes to background: ideally, one would still want the XMPP stream to be active for at least a few minutes so that a few messages could be received.
App is in the background for more than 10 minutes (or some limitation by Apple): the XMPP stream need not be active after the limit and the user could use some form of push notification to enable messages, etc.
App has been terminated by the user: the XMPP stream not be active here at all and the user could use some form of push notification to enable messages, etc.
Currently, I am using XMPP framework to handle multi-user chats, etc. Even in case 1 above, my XMPP stream dies, i.e. the user presses the home button and stops receiving any messages from the XMPP stream.
Q: Is this desired behavior? If not, is it ok to use enableBackgroundingOnSocket
on the main XMPP stream? Does this mean I am using VoIP? iphone XMPP App run background
Q: How do I achieve case 2 using the available XMPP framework.
Thanks