The app will be wake up from killed status by silent notification or not?

The app will be wake up from killed status by silent notification or not?

This is a question for years, from my test. It will wake up. Here the wake up means it will call the "didFinishLaunchingWithOptions" method. But we can not see the app in the "recent apps" list after switching home-screen up.

So any Apple dev can give me a detailed explain for this?

Answered by Engineer in 823910022

Depends on what you mean by kill status, and who killed the app.

An app could be "no longer running" due to several reasons. It could have been terminated by the system to free resources. Or the device may have been rebooted, and the app has not been launched yet. Or, the user may have killed it by swiping it away.

If the cause of the "killed status" is the last one, because the user has killed it, a silent notification will not cause the app to be relaunched (as you say, "wake up"). Period!

There are certain exceptions to this, for example if you are debugging your app at the time via Xcode, then the system will allow the app to "wake up", so you can continue debugging.

The important thing to understand about the "recent apps" list is, that only shows apps that were manually launched by the user. If the app is executed by Xcode, or launched in the background by another system event, the app could be running (or suspended in memory), but will not show up in the recent apps list. The recent apps list is not a list of running apps. It is a list of apps that the user launched.

But to simplify the answer, a silent notification will not wake up an app that was killed by the user by swiping it away. Any observations counter to that must have another explanation.


Argun Tekant /  DTS Engineer / Core Technologies

Accepted Answer

Depends on what you mean by kill status, and who killed the app.

An app could be "no longer running" due to several reasons. It could have been terminated by the system to free resources. Or the device may have been rebooted, and the app has not been launched yet. Or, the user may have killed it by swiping it away.

If the cause of the "killed status" is the last one, because the user has killed it, a silent notification will not cause the app to be relaunched (as you say, "wake up"). Period!

There are certain exceptions to this, for example if you are debugging your app at the time via Xcode, then the system will allow the app to "wake up", so you can continue debugging.

The important thing to understand about the "recent apps" list is, that only shows apps that were manually launched by the user. If the app is executed by Xcode, or launched in the background by another system event, the app could be running (or suspended in memory), but will not show up in the recent apps list. The recent apps list is not a list of running apps. It is a list of apps that the user launched.

But to simplify the answer, a silent notification will not wake up an app that was killed by the user by swiping it away. Any observations counter to that must have another explanation.


Argun Tekant /  DTS Engineer / Core Technologies

Thanks for your info, very helpful. One point to be clear: How to define the debug case: "for example if you are debugging your app at the time via Xcode".

Cable conntected? Open console app? Open Xcode connect device.

I tested my App store build and installed the APNs profile in my device. (iPhone 12 pro max, iOS18.3) Then I can see the app has been waken up from manual killed status from this method.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool

and the launchOptions like: Optional([__C.UIApplicationLaunchOptionsKey(_rawValue: UIApplicationLaunchOptionsRemoteNotificationKey): { action = StopRing; aps = { "content-available" = 1; }; event = "/restapi/v1.0/account/xxxx/extension/xxxx/stop-ring"; from = 101; fromName = Lxx; serverId = "10.74.13.129.TAM"; telephonySessionId = "s-98cdf84c5e474a80a671895c750a293a"; timestamp = "2021-04-23T09:14:11.971Z"; to = 101; }])

and how about the "ActivePrewarm" logic, will it impact this?

The app will be wake up from killed status by silent notification or not?
 
 
Q