Reputation: 412
So I've created a simple XMPP app, but it appears I can't have background processing unless the app is one of the designated categories listed here.
I just want to keep the socket open and display a notification on message received if the app isn't in the foreground.
I've found it a little difficult to find out good information on iOS backgrounding, it appears a lot of apps out there manage to do it some how, but the documentation seems a lot more restrictive.
Is it possible to run a chat client like this in the background for extended periods of time? Something similar to Androids Service lifecycle?
Upvotes: 1
Views: 2758
Reputation: 1848
When your app goes in background you (the client) close the connection with the xmpp server. When your app comes back into foreground you reopen the connection. If your server need to send messages to your client, it must use push notifications. When the client receives the notification CAN (it depends on the user action) can back to foreground.
Upvotes: 3
Reputation: 2284
It's not so easy like in Android. To preserve battery, apple has implemented a limit of 10 Minutes.
There is only 10 minutes, no backgrounding or unlimited backgrounding. So in your app, you have to get unlimited. I don't know if it is so easy, when your app doesn't exactly fit into the given list.
Upvotes: 1