0

There are multiple cases here and I would like to highlight them separately.

  1. 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.

  2. 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.

  3. 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

Community
  • 1
  • 1
p0lAris
  • 4,750
  • 8
  • 45
  • 80

1 Answers1

0

Apple pays much attention for the best practices and it is clear that your app shouldn't use a lot device resources when in background. So without enabling background modes support, your app will be frozen and described behavior is right one. However, if you enable background modes like in SO question you have linked, your app may be rejected because of absence VoIP functionality.

About your second question. It is not clear what framework you are using, but you also could connect to your backend something like PushWoosh or any other analogue

Azat
  • 6,745
  • 5
  • 31
  • 48