The APP is in the background for a long time. When entering the foreground, it will be restored from the back to the background page instead of restarting.

hello:

Our current status is that after three minutes in the background, re-opening the app is a restart. But I see a lot of other apps in the background for a long time (such as 20 minutes, 30 minutes), when I open the app, it is the page that opens into the background, I don't know how they do it, I follow Apple The rules did not do anything after entering the background. Is there anything that Apple can do?

Replies

>Is there anything that Apple can do?


Support isn't here. You might want to use one of your support tickets with DTS via the Member Center if you want an Engineer to get involved and talk to them directly.


Otherwise, can you talk about your app and what it does? Have you done any testing using Instruments to see how much memory it is using? How are you testing? Might be the system needs that back and is quitting your app in the background.

It's quite possible that what you think you see isn't what's happening.


When an app is sent to the background, it's responsible for saving its restoration state before being terminated. That means if it's actually terminated and launched again later, it restores the state that the user last saw. It *looks* like it's been there all the time, even if it hasn't.


It sounds like your app isn't doing any state restoration. You can start reading about this here:


https://developer.apple.com/documentation/uikit/view_controllers/preserving_your_app_s_ui_across_launches