Blank screenshot in app switcher in iOS 7 (HTML web app) - ios7

When switching between a Home Screen HTML web app to another app and back (iOS 7), the web app screenshot is just of a blank page. Is there a way of ensuring the screenshot reflects the actual state of the app before it went into background mode?

I think its because your app gets reloaded everytime. You might want to look at this thread here or here.
It looks like it is default behaviour and the only way you can work around this is to use localStorage.
EDIT: Of course you would have to save the state of your app everytime the user makes an interaction since you do not have AppDelegate methods which get triggered when your app goes to background.

Related

React Native stop WebView reloading when app comes to foreground

I'm working on a React Native app that uses a WebView as the app's main screen.
When the app comes from the background to the foreground the WebView reloads. How can I stop this reloading?
This answer suggests loading the WebView in ViewDidLoad() rather than in ViewDidAppear() or ViewWillAppear(). Is this a real solution and how can I confirm, or change, how the WebView is loaded by React Native?
As a hacky solution I'm using onNavigationStateChange to save the current URL in AsyncStorage and then load this URL when the app comes to the foreground. This solution isn't great because it:
Breaks the browser history, affecting javascript back buttons
Doesn't remember form state
Might send the user to a page they can't directly access, resulting in them being sent to a 404
So I'd much prefer a solution that stops the reloading, at least for situations when the app is only momentarily in the background.
This was not and issue with the WebView. The reloading was caused by my misuse of the React Navigation SwitchNavigator. As mentioned in the docs a SwitchNavigator
resets routes to their default state when you switch away
This reset caused the WebView to reload.

Disable launch transition in WP 8.1 app

I wonder if it's possible delete the transition that leads to my WP8.1 universal app when it's launched. So, when my app is launched, I want it to just show the SplashScreen without any animation. I've already read this and this questions, but since I'm not navigating between pages within my app, I can't just set "ContentTransitions" of my frame to null.
Does anybody have any information on this? Or is it just not possible, since these "launching" transitions are managed by the OS?
Disable the animations on the Frame, hook up the Frame`s navigated event and enable them back after first navigation. I have a post about this here.
The initial splash screen is displayed by the OS until you call Window.Current.Activate(). You cannot disable/modify this transition, and you should also not try to do so as your app will lose parity with the rest of OS ecosystem.

how to keep ios app using opentok video chat in foreground

I've integrated opentok ios sdk in my iOS 7 app, it is working fine, except this problem:
During video chat if I don't access iPhone for 5-10 seconds..then my app moves into background, causing viewer at other end to hear only audio. Video is disabled after app goes to background state.
I've observed same thing with their official example
https://github.com/opentok/opentok-ios-sdk/tree/master/samples/OpenTokFullTutorial
How can I avoid my app going to background while video chat is ongoing. Skype is working fine in this case, I want to achieve same thing.
What you want to do is prevent the iPhone from going to sleep. To do this, you cant try this:
[UIApplication sharedApplication].idleTimerDisabled = YES;
Here is iOS documentation on idleTimerDisabled
If you don't want the app going into background at all (like when the user taps on home button), you can opt to kill the app when it's not running instead of having it run in the background. To do that, check out iOS guide on opting out of background execution
If you do not want your app to run in the background at all, you can
explicitly opt out of background by adding the
UIApplicationExitsOnSuspend key (with the value YES) to your app’s
Info.plist file. When an app opts out, it cycles between the
not-running, inactive, and active states and never enters the
background or suspended states. When the user presses the Home button
to quit the app, the applicationWillTerminate: method of the app
delegate is called and the app has approximately 5 seconds to clean up
and exit before it is terminated and moved back to the not-running
state.
Hope that helped!

iOS Multitasking App Launch

I developed an app for IPhone and it's posted to itunes for approval. Now when I test the app I found out a strange behavior which I think should be rectified. When I launch app first time, the app launched and when I press home button it closes but when I tap the app icon to open it again it opens where it was last closed.
How can I change the view to first view of the app when it's launched after closing by Home screen button?
If you don't want your app to run in the background you need to set the "Application does not run in background" key in the info.plist file. This means that your app will completely restart every time your user returns to it. Take time to decide if this really is the best move for your app. Allowing users to return to where they left off or remembering information about the last session can be a big plus.
If you do not set the info.plist value like I mention above you can manage the way your app behaves by using the: applicationWillEnterForeground: in UIApplicationDelegate or you could observe UIApplicationWillEnterForegroundNotifications. Read up on all the available notifications and methods available for this in the UIApplication Delegate documentation.

UITabBar not selected during app startup

I'm trying to replicate the look of my app during start-up with how iTunes and App Store appear.
Specifically my app has a tab bar that will get populated when it has finished downloading info from a web site - until then it should look empty. The only way I can appear to do this so far is to have an empty name and image for the UITabBarItem. It's only minor, but this item is 'selected' and is therefore a "lighter" color.
I got around this by showing an image that I created by taking a screenshot of the App Store app then showing this during app loading. When ready to populate the UITabBar simply add the bar items they are shown immediately.