Black screen on launch when migrating to SwiftUI application flow - ios

I have done all of the refactoring to migrate from SceneDelegate to using a SwiftUI App and Scene with WindowGroup. I noticed that when the app is updated from the previous version, the app launches to a black screen, and you can't do anything with it. No matter how many times you quit and relaunch the app, nothing is navigable. I can log something in the init function of the App struct, but not in the onAppear modifier.
Uninstalling the app and installing it fresh works fine, but I don't want users to have to do this (I verified that this issue also happens when updating from my released app to a TestFlight beta).

The best way to get around this seems to be to leave the info.plist configuration that tells it to look for the SceneDelegate class (UISceneDelegateClassName), but delete the scene delegate. This will cause warnings in the console on launch, but the black screen issue will stop happening.

Related

After migrating from SwiftUI to UIKit App Delegate Life Cycle, why am I getting a black screen on first launch?

Due to factors outside of my control, I need to migrate my app from SwiftUI to UIKit App Delegate lifecycle.
I've added an AppDelegate, Scene Delegate, and updated the info.plist.
After the conversion, the app starts up fine when installed for the first time.
The problem is when I install as an update from a previous version of the app that uses the SwiftUI life, I get a black screen. If I then restart the app after getting the black screen, it works fine thereafter.
The app is already live in the App Store, so I need to release as an update and do not want users to get a black screen and have to restart the app.
I installed Xcode's sample 'Hello, World' app and did the same migration and am having the same black screen issue. Same issue from a TestFlight build.
When stepping though with the debugger, willConnectTo in the SceneDelegate is never executed.
Any ideas of how to fix or troubleshoot this?

libGDX iOS home button kills the game

I'm developing a libGDX game for Android and iOS (MobiDevelop's RoboVM fork). Android works perfectly, but I have a issue on iOS. When the iPhone home button is pressed to leave the game, and I launch the game again by tapping on icon, the game does not resume from where it was paused, but instead restarts, which means the loading screen is displayed, all assets are reloaded, and the main menu appears. Like a fresh/new start of the app. I do not have any specific configuration for the iOS module in my libgdx project and am using what was pregenerated.
Is it possible to tell iOS that I do not want to kill the process? I want to switch to pause/sleeping mode only.
I found a reason of this problem. I tested it on the real device, therefore I was unable to see a logs. When I switch to simulator and look at the logs, I found a NullPointerException. This was a cause of application crash. When I fix this bug, everything works as I expected. After iPhone home button is pressed, pause() method of com.badlogic.gdx.Screen is called and after rerun the game, it continues from exactly where it stops / pauses.
I learned a lesson: make a tests on simulator at first :-)
While I am entirely unfamiliar with libGDX, I can tell you that except for a few very specific cases (VOIP etc.), you cannot control what iOS does with your app when the home button gets pressed.
Furthermore, it is the responsibility of the developer to save the app's state when the app leaves the foreground since this is not something that is or can be handled automatically in a performant way.

How to force a call to getPlaceholderTemplate on Apple Watch simulator to update complications preview

I made the mistake of installing the app on the simulator without having set up all my complication templates. As the docs state, getPlaceholderTemplate gets called one time and then cached.
So now that I have all my Watch complication templates set up, I want to text them out by customizing the Modular face. But only the one template I had originally created will show up, the rest have the white box. This is just the static template I'm concerned about.
I've tried deleting the app from the simulator, removing it via the Watch app, re-installing, but still doesn't seem to call the function again to update the templates. Any thoughts? Thanks.
What I do to resolve this is click Simulator > Reset Content and Settings... in the Menu Bar for both iPhone and Apple Watch simulators.
Uninstall the app and then re-install using the Watch app on iPhone Simulator

App struck in splash screen or launch screen in ios

Sometimes app is working fine, but sometimes it will get stuck in the launch screen.
I tried many things like changing the provisioning profile, restarting my Mac, quiting Xcode, and quitting the iPhone Simulator.
Xcode version is 7.3.0, macOS 10.11.4
I don't know what to do next. Please help me with this issue.
If your app hangs at launch, you should check your AppDelegate's didFinishingLaunching and the initial view controller's viewDidLoad.
Seems it might be taking some time to appear.
Check the code what you are running in didFinishLaunchingWithOptions method.
Any Server calls making it to take that much time.
Try the way by debugging from AppDelegate to viewDidLoad method of initial viewcontroller.

App stays in splash screen in iOS 7.0.3

Recently in iOS 7.0.3, my app stays in the splash screen and was not going into the app at all.
If i kill the app and launch it again it opens up without any issues.
Can anyone help me on this issue?. I think the application -didFinishLaunchingWithOptions was not returning yes.
Note: I have a lot of stuffs like deleting database, initializing a dozen of buttons in appdelegate init function.
I know that it is a bad practice to have things in init but since its been there for more than 4 years and was working fine with previous OS versions i didn't find a good reason to change it.
Also this issue is not happening all the time.
My app size is 40 MB.
The iOS Guidelines say that you should not include anything which holds the Splash screen for much time its better if you do all the process in background so that splash screens loads up and user can play with app. But as you said your issue is not all the time so Try to reset the app and also quit simulator. Hope this helps.

Resources