1

Alarmy (iOS app) has a neat feature that plays alarms even when in background. This is what their FAQ says about it:

Due to Apple's technical policy, applications are not authorized to ring if they are not running in the background. To prevent this, Alarmy is by default configured to constantly run in the background, and this may consume additional battery. You can save battery by going in to our in-app battery-saving mode, but note that in this configuration, alarms will not ring when the phone is in Silent or Do Not Disturb mode!

How can I write an app that can run in the background this way?

Geoffrey Wiseman
  • 5,459
  • 3
  • 34
  • 52
Ali Mir
  • 565
  • 7
  • 20
  • Possible duplicate of [App "Alarmy" is able to play iTunes song from background state... How?](http://stackoverflow.com/questions/22823126/app-alarmy-is-able-to-play-itunes-song-from-background-state-how) – Andrew Feb 01 '17 at 10:35

1 Answers1

4

See the docs about iOS background modes here.

Mainly there are a few use cases when doing stuff in the background is allowed:

  • Apps that play audible content to the user while in the background, such as a music player app
  • Apps that record audio content while in the background
  • Apps that keep users informed of their location at allntimes, such as a navigation app
  • Apps that support Voice over Internet Protocol (VoIP)
  • Apps that need to download and process new content regularly
  • Apps that receive regular updates from external accessories

I suspect the app you mentioned hacks into one of those categories.

Bogdan Farca
  • 3,856
  • 26
  • 38
  • 1
    This is correct. There are four separate privileges your app could use to run in the background. Be warned, though: Falsely requesting one of these privileges could result in your developer profile being banned. Also, most require a battery use disclaimer... Or at least, they did. Our very first submission was rejected due to not having that disclaimer. However, our latest submission spit back a message saying that since we use one of those privileges, a disclaimer would be added to our app store listing, so perhaps Apple has automated that disclaimer? – Jake T. Jan 05 '17 at 18:48
  • Which of the above would be appropriate to choose? I suppose one hack that includes adding a feature - for example - showing up-to-date news based on user's current location that would fulfill the third requirement (i.e. Apps that keep users informed of their location at allntimes, such as a navigation app) – Ali Mir Jan 05 '17 at 23:51
  • 1
    Hmm, I wouldn't recommend such a hack, it will blow in your face at some time, sooner or later I guess. So unless your alerts are organically linked to one of the approved use cases, I would steer clearly away of "gaming the system". – Bogdan Farca Jan 06 '17 at 08:30