I have a ios application,can send/receive messages to/from xmpp server.
3 main states of the app are:
- If this app is active,it maintains a persistent connection to the server,and it send/receive messages through this contention.
- If this app is exited,the connection was disconnect; the xmpp server can push messages to this user’s iphone via APNS.
- If the app switch to background , but not exited; the connection is not disconnect,the xmpp server can also send messages to this app, but this app can receive these messages until switching to active.
WRT the 3 states, I have a question:
When the app switch to background ,the connection is not disconnect, can the app receive these messages,then notify user via local notification?
If possible, how can I do? or,in this situation ,should I notify user via APNS?
If I’m not wrong, when the app switches to background, the connection is lost after a few seconds/minutes. Unless you have marked your app to support VOIP.
Maybe you can go through the below links :