Will BGAppRefreshTask be triggered when app is killed for OOM in the background?

I know that BGAppRefreshTask will not be triggered in background when user has forced killed the app.

But if user only presses the home button or swipes up the screen to make the app info background, and after a while the app was terminated in the background for OOM, will BGAppRefreshTask still be triggered in this case?

Answered by DTS Engineer in 739468022

I know that BGAppRefreshTask will not be triggered in background when user has forced killed the app.

Correct.

will BGAppRefreshTask still be triggered in this case?

Yes.

When the user moves away from your app, it will be suspended in the background. If they stay away for long enough, it’ll be terminated. None of this prevents the app from running in the background again. If the system decides to honour your app refresh request, it’ll resume (or relaunch) the app in the background.

IMPORTANT That’s a big “if” btw. The system will generally only honour app refresh requests for apps that the user uses regularly.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

I know that BGAppRefreshTask will not be triggered in background when user has forced killed the app.

Correct.

will BGAppRefreshTask still be triggered in this case?

Yes.

When the user moves away from your app, it will be suspended in the background. If they stay away for long enough, it’ll be terminated. None of this prevents the app from running in the background again. If the system decides to honour your app refresh request, it’ll resume (or relaunch) the app in the background.

IMPORTANT That’s a big “if” btw. The system will generally only honour app refresh requests for apps that the user uses regularly.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Interesting. As you said OS may honour the app refresh requests even if the app is terminated. But if OS tries to launch the app in background then during the app launch in the appDidFinishLaunching method, the same BGAppRefreshTask would get registered again and most probably would be scheduled again. Since the same task gets rescheduled again, i am wondering how will the launchHandler of the task execute at this point in time.

Will BGAppRefreshTask be triggered when app is killed for OOM in the background?
 
 
Q