How much time usually an iOS application takes to get suspended from the background state?

Viewed 572

I need my iOS application to work continuously on the background mode but seems it gets suspended after a while. I've 2 questions here:

  1. Is there any definite time for the application to get suspended from the background?
  2. Is there any way I can get the specific time of this suspension process?
1 Answers

I can be proven wrong on this one, but don't think Apple has posted that, because it depends on many factors that are unique to each device:

  • the amount of memory that device has
  • the number of apps that iOS has been running previously
  • size of your app (thanks to BitCode you only download parts relevant to your device's architecture)

So short answer is NO, you can't get that number.

Good news is you can extend the time your app stays "alive" in the background: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_background/about_the_background_execution_sequence

Although iOS can kill your app at any time for any reason, if it needs more resources.

Related