iOS 14 app killed immediately after being minimized and receiving snapshot warning - ios

My IOS 14 app is always being killed immediately when it is being minimized. I have already added background modes: background fetch and background processing. However, when the app goes into the background and I switch to another app, XCode is telling me this:
Snapshotting a view (0x7f91ed844000, UIKeyboardImpl) that has not been rendered at least once requires afterScreenUpdates:YES
So I thought maybe the app can't create screenshots for the app switcher and Apple then just kills the app. My problem is that the message doesn't tell me how I can add this to the view. The documentation doesn't help me either also Google and searching here doesn't help. Everything I find is about how to take a screenshot and save it somewhere which is not what I am trying to do. Does anyone have an idea how I can approach this problem?
Thank you very much!

Related

LibGDX displays black screen while app is paused but still visible (e.g. during in-app purchase password dialog) on iOS

I converted one of my apps over to LibGDX.
In the earlier version, when I launch an in-app purchase and iOS shows the dialog to ask the user for their password, my app would stay visible and running (animations would update) in the background behind the dialog.
After the switch to LibGDX (and no other changes regarding purchasing), the app now disappears and the background behind the password dialog is just black. Right before this happens, LibGDX reports [debug] IOSApplication: paused and right when my app comes back to life, I get the message [debug] IOSApplication: resumed.
Is there any way to have LibGDX keep updating my app's screen while it's paused (preferably only if it is still partially visible, though), or at least keep displaying the last drawn frame rather than switching to black?
PS: I have continuous rendering turned off.
I found a way to fix the problem: Get rid of LibGDX.
Here's how: https://stackoverflow.com/a/35094695/1217178
Disclaimer:Clearly this isn't a true answer to the original question, but unfortunately I don't have the time to go hunting for bugs in libGDX, especially since my app is almost 1MB (15%) smaller and starts faster without it, too. But if someone else comes across this issue and figures it out, please do post your answer and I will accept it instead of this one.

Background App Fetch and App Snapshotting

I am developing an app where I use iOS's "background app fetch" to keep the data of my app up to date. This is working fine except the "snapshot" of the app is not updated with this fetch.
When I say "snapshot" I mean the image that iOS takes when it goes into the background. This is the image that is displayed for the second before your app loads. At the moment this means users (particularly those on older phones) may see old information for a second or so then have it replaced with new information.
Does anybody know more about when the app takes the snapshot and if this can be forced (for example when I fetch new data in the background).
Alternatively can anybody think of a way I can achieve this effect?
Check out the documentations on Managing the State Restoration Behavior. It's not possible to update the snapshot once you loaded new data from the background. What you can do is to just tell the UIApplication to not show the snapshot but the default launch image using -ignoreSnapshotOnNextApplicationLaunch.
In my opinion however, this shouldn't be necessary. I can image that Apple will improve this with iOS 9.
How about resetting your app to a "neutral" state when it is about to enter the background? Displaying an empty table, for example.
You won't have the latest data, but you won't have wrong data either.

iOS Application is not resuming where it left off?

I am facing the above issue and unsure why it is happening or how to fix it. When the app goes to the background and is later reopened, it always starts from the initial view.
I would like it to show the view that was shown when the app was dismissed - which is usually the default for iOS apps.
Can someone please explain why this might be happening and how I can resolve it.
Your app is probably killed while in the background to free it's resources for other tasks.
If applicable you can opt to use a background mode for your app so it keeps running in the background. This is possible if you require location updates, play audio or interact with bluetooth le devices.
By your description it's more likely you want to implement State preservation and Restoration (Programmig Guide)
Even if your app supports background execution, it cannot run forever. At some point, the system might need to terminate your app to free up memory for the current foreground app. However, the user should never have to care if an app is already running or was terminated. [...]
The state preservation system in UIKit provides a simple but flexible infrastructure for preserving and restoring the state of your app’s view controllers and views.
If you are on an iPhone older that the 3GS, this is normal. Apps are closed instead of backgrounded on these older models.
The other possible reason is that you've set
UIApplicationExitsOnSuspend=YES
in your Info.plist. In that case, your app will also always terminate when going to the background.

iOS Splash screen appears when application is reloaded from background

The splash screen of my app is showing when I reload the app after clicking the home button. It doesn't happen every time. It only happens when I press the home button while the app is creating a movie with AVFoundation and the reload the app.
Anyone have any idea why this is happening and how can I tackle the problem?
Thanks a lot!
It sounds like your app is actually being shut down, not just put in the background. It may be doing too much processing after being sent to the background so that the OS kills the app.

iPhone: Is it possible to close the app rather than run in background when user clicks Home Button?

I have an app which crashes everytime when I resume it.
I want that when user clicks Home button, the app should close rather than go in background mode.
Is that possible?
If yes, please let me know.
If not, what could be the workaround so that my app does not crash when I resume it?
Thanks!
In the plist, set YES to Application does not run in background key.
When ur application is in background, due to memory insufficient, the views (and the objects released in viewDidUnload) might be released. Again when reopen the application, make sure all the required objects are re-initialized.
To opt out of background execution, see this thread... But ideally what you should do is fix the crash and let app user enjoy iOS background feature..
what could be the workaround so that my app does not crash when I
resume it?
Never think of work arounds when you can handle it straight..

Resources