2

I'm developing an application only for company’s internal use.(iOS 5 and later)

The application does some tasks and then has a lot off calls to multiple web services.(Some information is read/write from core data). The problem is that all calls together take longer than 10 min.

How can I keep a thread in background communication with web services forever? Can I create a new thread each 10 min?

António
  • 975
  • 1
  • 12
  • 31
  • Since you're dealing with iOS 5, there's not a lot your can do app-wise. You could create a batch process where the app sends a bulk request to a single server who starts doing the work and gives back a token that can be used for tracking status and retrieving data. – Brian Nickel Sep 24 '13 at 20:51

1 Answers1

1

Only certain types of apps can run in the background longer than 10 minutes.

In your case, you might want to look into "Background Fetch" mode, that is new to iOS 7.

See here:

iOS App Programming Guide

bandejapaisa
  • 26,576
  • 13
  • 94
  • 112
  • I need compatibility with iOS 5 and later – António Sep 24 '13 at 20:34
  • 1
    Have a look at this post: http://stackoverflow.com/questions/9738488/run-app-for-more-than-10-minutes-in-background – bandejapaisa Sep 24 '13 at 20:40
  • Can I use voip mode to keep creating threads forever to call the webservice? Will that work? – António Sep 25 '13 at 09:01
  • If the app is only for internal use, then you can pretty much do what you want if it's not going on the app store. I haven't tried to do what you're doing before - but you only have to set a value in Info.plist and give it a go yourself to see if it works. – bandejapaisa Sep 25 '13 at 09:16
  • I tried with voip mode, but when the voip callback is called after 10 min I only have a few seconds and if I created a new thread it is suspended. I wanted a solution where the thread will keep running without breaks forever, but no luck.. – António Sep 26 '13 at 14:10
  • Más Colombiano pa'donde jajaj +10 – Frederic Yesid Peña Sánchez Oct 16 '13 at 20:29
  • Hehe, I'm not even Colombian, my wife is. Pero mé gusta mucho la bandejapaisa! – bandejapaisa Oct 16 '13 at 20:40