Display a view or splash screen before applicationDidEnterBackground (to avoid active view screenshot)

I think the problem is that you are testing in simulator. On device, it should work fine. I tested this and it worked. Add an imageview with your splash image when app enters in background – – (void)applicationDidEnterBackground:(UIApplication *)application { UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.window.bounds]; imageView.tag = 101; // Give some decent tagvalue or … Read more

Conditionally start at different places in storyboard from AppDelegate

I’m surprised at some of the solutions being suggested here. There’s really no need for dummy navigation controllers in your storyboard, hiding views & firing segues on viewDidAppear: or any other hacks. If you don’t have the storyboard configured in your plist file, you must create both the window and the root view controller yourself … Read more

applicationWillEnterForeground vs. applicationDidBecomeActive, applicationWillResignActive vs. applicationDidEnterBackground

When waking up i.e. relaunching an app (either through springboard, app switching or URL) applicationWillEnterForeground: is called. It is only executed once when the app becomes ready for use, after being put into the background, while applicationDidBecomeActive: may be called multiple times after launch. This makes applicationWillEnterForeground: ideal for setup that needs to occur just … Read more

Scheduled NSTimer when app is in background?

You shouldn’t solve this problem by setting a timer, because you’re not allowed to execute any code in the background. Imagine what will happen if the user restarts his iPhone in the meantime or with some other edge cases. Use the applicationDidEnterBackground: and applicationWillEnterForeground: methods of your AppDelegate to get the behavior you want. It’s … Read more

Detect if the app was launched/opened from a push notification

See This code : – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { if ( application.applicationState == UIApplicationStateInactive || application.applicationState == UIApplicationStateBackground ) { //opened from a push notification when the app was on background } } same as -(void)application:(UIApplication *)application didReceiveLocalNotification (UILocalNotification *)notification

Handling applicationDidBecomeActive – “How can a view controller respond to the app becoming Active?”

Any class in your application can become an “observer” for different notifications in the application. When you create (or load) your view controller, you’ll want to register it as an observer for the UIApplicationDidBecomeActiveNotification and specify which method that you want to call when that notification gets sent to your application. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(someMethod:) … Read more