1

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?

Autonomy
  • 402
  • 4
  • 13
  • Looks like I have to use [Push Notifications](http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html). Seems extremely overcomplicated considering I already have a socket open with a secure server... Would love somebody to confirm/deny. – Autonomy Apr 19 '12 at 14:46

2 Answers2

3

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.

Francesco
  • 1,840
  • 19
  • 24
1

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.

Fab1n
  • 2,103
  • 18
  • 32
  • Do you have any idea how the likes of IM+ and Facebook manage to have long running notifications? – Autonomy Apr 19 '12 at 14:37
  • I don't think they are doing that with notifications out of multitasking. I think they just send you push-notifications – Fab1n Apr 19 '12 at 14:51