1

I understand that this issue has already been covered extensively in the past, but I'd like to readdress it it appears that there is a lot of mixed messaging around the subject.

I have an application that should be periodically updated, roughly once a day at the minimum, to run some maintenance tasks. I have researched extensively on how to achieve this behaviour, but options such as background fetch and silent push notifications do not appear to work when the app has been terminated (swiped up on) by the user. (see this link for app states)

Will IOS wake up my app if it is in the terminated state, for example, if a user has swiped up on the app? I would like to find a solution that allows me to have the app run in the background in as many circumstances as possible.

What are my options here?

The Swift Coder
  • 390
  • 3
  • 13
  • Does this answer your question: https://stackoverflow.com/questions/40449640/perform-background-tasks-when-app-is-terminated? – Rob May 11 '21 at 04:53
  • Yes, I saw that post previously, and I think the answers on it are the most comprehensive on the subject that I've seen so far. – The Swift Coder May 11 '21 at 05:01
  • If an App is terminated, you can use Silent Push Notifications with Background Refresh, but not sure if it will fulfill all your requirements. – Rob May 11 '21 at 05:03
  • Is using Silent Push Notifications in tandem with Background App Refresh a common strategy for apps attempting to update periodically? – The Swift Coder May 11 '21 at 05:08
  • You should think about whether the app really needs to perform the maintenance tasks once per day if the user has killed it. The simpler approach is to perform the maintenance tasks when the user relaunches the app. You can easily determine how much time has elapsed since the last time you performed maintenance and do what is needed. – Paulw11 May 11 '21 at 05:21
  • What do you mean by 'update'? – Rob May 11 '21 at 05:21

1 Answers1

0

It is not possible to run a terminated app with Swift. Once an app has been terminated, it is no longer running and cannot be restarted. The only way to run the app again is to open it from the device's home screen or app launcher.

BH Lee
  • 1