3

This is more of an is-it-possible question.

I am building a pubsub application for the iphone using XMPPFramework and Openfire. When the user has the pubsub app in the background, the app sends "keep alive" packets every 10 minutes or so to keep a persistent connection. Any messages delivered will show up as local notifications.

But what about if the user has killed the app or it's been a week since they've used it and the app isn't in the background? How would they know that they have a message waiting for them?

Is it possible to combine Openfire's pubsub service with Apple's push notifications? Am I on the right track? Thanks!

Keith OYS
  • 2,285
  • 5
  • 32
  • 38
user798719
  • 9,619
  • 25
  • 84
  • 123

1 Answers1

1

The limitations you're envisioning were constructed purposely to only allow certain types of applications to run in the background with long-lived connections indefinitely (namely, VOIP applications). You could experiment with setting the UIBackgroundModes key to 'voip' (see: Apple's Documentation).

Non-VOIP applications don't have this luxury (presumably as a safeguard against battery life or network utilization issues) and won't be permitted in the appstore if they have the VOIP UIBackgroundModes value set.

Consideration of Apple's Push Notification Service is definitely the right approach, IMHO.

cdelargy
  • 56
  • 2
  • OpenFire, my XMPP server, would need to be able to send a payload to APNS (Apple's Push Notification service) in order for push to work. Does such a module exist, in Openfire, or Ejabberd, or any other XMPP server? Has anyone done this? – user798719 Jan 27 '12 at 05:05
  • The module exist for ejabberd, as a commercial module. See: http://www.process-one.net/en/imstore/#impush – Mickaël Rémond Jan 30 '12 at 10:32
  • I'm not aware of an open source plugin, but you could build one as a plugin for Openfire using a Java publisher for APNS such as: http://code.google.com/p/javapns/wiki/How2UseJavapns – cdelargy Jan 30 '12 at 19:12