ios applicationDidBecomeActive stuck on splash screen - ios

I'm experiencing a phenomena that after a long time the app was in the background (and probably was ejected from the memory) - after running applicationDidBecomeActive (I see logs from it on the device log) it stays on the splash screen and stays there until I kill the app and restart it
Happens on an iPhone4 with iOS 7.1.2 (don't know about other devices, or if it happens on iOS8 as well)
Is there something I need to do in applicationDidBecomeActive to get the entry screen going?
P.S.
There is a facebook [FBAppEvents activateApp]; invoked - I don't know if it is relevant or not...

well..it is really depend on the app ,the device and how you are using you device.
test it. try to create a new view controller and present it.
if it is presented, i assume that all your view controller were release from memory .

Related

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.

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.

iOS app freezes after closing it, then black-screens after closing it again

I'm testing my iOS app on my iPhone 4S (running iOS 6 or lower, I believe), which is a simple web browser. When I double tap the home button, close the app (by pressing and holding it, and clicking the "X" which appears), and click the icon to run it again, the app is frozen on the page it was on before being closed. When I then close and click the icon again, it doesn't load; the app simply stays open as a black screen, and doesn't even crash. How can I solve this problem?
Edit: My iPhone is running iOS 6.0. And I cannot see anything in the logs as I completely stop running the app. I'm new to iOS dev, so please be kind!
Edit 2: Issue solved. See my answer below.
The only option I can suggest you here is to debug your app. Whenever the app opens up after being terminated, didFinishLaunchingWithOptions in your AppDelegate class is called.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Try putting a breakpoint in there and check whats going on. Apart from this I cannot help you much.
I solved this issue by restarting my device (pressing and holding the power and home buttons). It seems the error was in some deep-ingrained code, and not in my own code I had written myself.

App hanged only in iPhone 4 with iOS 7.1

I am creating an iPhone app with some user authentication screens. I have created these screens in Storyboard. For example, landing screens, sign in screens, Sign up Screens etc.. and made connections between them using model segue. Every things work fine.
The Problem is that the app hangs in my iPhone 4 with iOS 7.1. I have also tested it on 4s, 5 and 5s all with iOS 7.1. In all these devices App works fine and fast without hanging.
Can anyone suggest me why it hangs when i go from one screen to other screen like (Sign In, Sign Up, etc..) in iPhone 4.
Since you are using Google Maps SDK, you could check this issue.
I encountered the same problem, and in the end I ended up switching to Apple maps, since Gmaps has a tendency to leak memory, for what I witnessed at least...
iPhone 4 is a single-core device while all the other iOS7 ready devices are dual-core. Maybe it can't keep up with initializing your view and thats why it lags.
You should try Time Profiler from Instruments to catch what is too much for a single-core device.
I have this same error when I was trying to launch an UIAlertView in the start of application.
Try not to launch do anything in main thread before you have set your window key and visible in
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
...
[self.window makeKeyAndVisible];
}
I hope this helps

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