UIWebView goBack() issues in iOS 5 - ios

I'm displaying a UIWebView to display a mobile website. The website uses ajax and internal hash navigation. I have a back button to go back in history.
It works fine on iOS 4 and on iOS for the first time after application launch.
After leaving the UIWebView and coming back to it, the back button does not work properly because of the caching.
Any ideas how we can get the back functionality/history keeping working in iOS5? We have tried several things on the web page, and natively, but no success.
Our current status is that clicking the back button will return to the initial page on the UIWebView, but jump over the intermediate pages.

Related

How to return form the web(iOS) back to the app?

I am using an online builder for my app(ApperyDotIo, JQM framework). My application works fine with one exception. I have an in-app link to my website. The link in the iOS app, the link takes me to the page but since the iPhone doesn't have a "back" button I can't go back to the app. Looks like you have to close the app and then reopen it to get back into the app.
I tried to set the link to not open in the same window and vice versa.
Any easy work around?
Links and back buttons in Android apps work fine.
Thank you
You can consider using the inAppBrowser: https://docs.appery.io/docs/cordova-jquerymobile-inappbrowser
It will allow you to open the website in the child window of the application (with the "close" button) or in the native browser, without opening the website as application page.

How does iOS 13 Safari link preview work?

In iOS 13 Safari, when you long press on a link, you see a preview of the linked page, along with some menu items. If you tap the preview, you navigate to that page.
Now, I see how to intervene in the long-press-and-preview process. This used to be peek-and-pop, but in iOS 13 that's deprecated and we're supposed to use func webView(_:contextMenuConfigurationForElement:) and so forth. Fine, but how would I imitate what Safari does?
The problem is that as my preview provider I have to supply a view controller. So I'm going to need a different view controller with a web view showing the linked page. Okay, I can do that. But then when the user taps the preview to dismiss it, I want to respond by loading the same linked page into my real web view.
But that's the problem. That loading takes time. In Safari, by contrast, when you tap the preview, boom, there's the same page already loaded. How do they do that? How would I do the same thing? How can I load the page into a different view controller, cache it, and communicate that cached page back to my real web view?

How to remove or disable address bar in ipad safari?

I have a web application. When I am running my web app on the iPad ... I need to hide or disable the address bar in safari browser with iPad.
This isn't a feature that the Safari web browser on iOS provides websites with. When you see this done in iOS, it's because the application is creating a UIWebView on it's own ViewController. You might be able to scroll the page down on page load, however. This would cause the navigation bar to be "hidden" until the user interacted with it or scrolled up.

FaceBook JavaScript API in native app UIWebview

I am creating an app which is reusing some of the HTML pages from my site. In one of the pages, there is a share event in facebook functionality. This is not working in UIWebview as there is no concept of "pop ups" in uiwebview. FB.Login() opens a new tab in an actual browser, but in UIWebview, it loads on top of the existing page.Hence after login, while the actual browser tab closes itself and transfers the control to the callback function in the original tab, UIWebview page just turns blank as it probably cannot find the original call back function anymore. Any solutions?

iPad Home Screen App refreshes on every open

I'm writing a web app for the iPad using HTML5 and SenchaTouch. The app uses cache manifest to function offline. Once it has been added in the home screen and opened without Safari, it will refresh itself every time it is opened, even if just navigating to the home screen and back. The desired behavior is to leave the app, do something else, and then come back to the app with everything untouched.
An example of a similar app that displays the same (undesired) behavior can be found here: http://ignitedmediadesign.com/WebApp/index.html
I've read that using a cache manifest should have solved this problem on iPhone ( http://www.stevesouders.com/blog/2011/06/28/lack-of-caching-for-iphone-home-screen-apps/ ), but doesn't seem to have done the trick for either iPhone or iPad.
Is there another way to fix this? Is there some secret to cache manifest files that stops this that I may have missed?
I'm under the impression this is simply the nature of the "home screen" web apps that operate outside of normal Safari. I have an app that operates just fine in Safari with some minimal state saving, but the blasted non-Safari version refreshes every time. EDIT: Even the showcased O’Reilly example that uses a cache manifest reloads every time when added to the home screen.
You may want to look into creating "routes" (URL fragments) that point to a controller/action pair. Look into the MVC PhoneGap example (If not using PhoneGap, you can scroll past all of that stuff and implement your own data model and store). Also see this Sencha Touch MVC tutorial.
Also, most of the rendered sencha touch components seem to maintain state between changes of the active item. For example. I have a main TabPanel that contains all sub panels. When switching between tabs on the main TabPanel's TabBar, each sub panel maintains its rendering, unless I've set a listener or controller action to do otherwise.
Hope this helps.

Resources