0

My application is suspended by iOS after some time -- from one hour to several days -- but I want it to work in the background as long as possible (maybe infinitely) while the device is running. SMS will notify the user all the time that the device is running -- iOS doesn't kill the SMS service. My app has similar functionality and should notify user about the new income messages and so on.

So can I do the same with my application? Maybe there is some hack?

2 Answers2

4

No.

There are the following exceptions:

  • Playing music
  • GPS tracking
  • VoIP

Also, all apps can get up to ten minutes to finish existing tasks.

There should be an answer if you're prepared to jailbreak, but otherwise, it's not possible with current versions of iOS.

The way around this is to do the processing on a server and send push notifications when something interesting happens.

Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152
  • You've said about the exceptions.Can I make my app a VoIP? –  Mar 27 '13 at 16:26
  • 1
    @AlexanderKaraberov It doesn't sound like you're building a VoIP application, so your application would be rejected by Apple for abusing Apple's background modes. – RileyE Mar 27 '13 at 16:27
  • 1
    @AlexanderKaraberov Not unless it _is_ a VoIP app. (Put another way: yes, it will work but, no, Apple will reject it when they review.) – Stephen Darlington Mar 27 '13 at 16:48
0

You don't want your application running indefinitely.

You should use push notifications. This will notify your user the same way the SMS application does.

RileyE
  • 10,874
  • 13
  • 63
  • 106
  • Push notifications don't make apps stay in BG. silent push notification can awake the app from suspended state to BG state and they are very limited(only 2 or 3 silent notifications per hour are allowed by apple, rest is ignored). Trying to prevent your app being suspended with unsolicited ways will make apple reject your app. – ramazan polat May 04 '19 at 23:42