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?