Auto refresh UIwebview issue in ios? - ios

I have developed an app in which I load the data into webView. My webpage refresh in every 5 seconds through an ajax call. It is working fine in android. Rendering of page in android is very fast. It doesn't seem that url is reloaded in android but in iOS when page refreshing is very slow. Can anybody please tell me the solution?

Have you tried using WKWebView instead of UIWebView?

Please Refer to Is Safari on iOS 6 caching $.ajax results? link.
I think it will solve your problem if you do not allow cache data to load while refreshing UIWebView

Related

Is there a function in ios webview like setCacheMode in android webview?

What feature should I use to allow iOS Webview's web content to be cached only for in the expired time in the server's meta data? I can't find keywords.
In Android Webview I solved it with setCacheMode (default).
Please WBWebKit instead of Webview.
it will give you access for cache setting using the following code:
webView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);

CrossDomain in UIWebview

Hey erveryone,
im currently working on an app which should contain an uiwebview to show a website with some reports (used a website because we want to show it also on android).
The data for the reports were loaded from another page by ajax with cross domain headers (Access-Control-Allow-Origin headers are set) and it worked fine in firefox, chrome and the other standard browsers.
It also worked on mobile safari.
But nevertheless this did not work in the uiwebview.
The uiwebview is loading and displaying the website but without the data.
The base part of the code is :
[self.webView loadRequest:[NSURLRequest requestWithURL:[APPCONTEXT.service reportGetWebPageURL]]]
Should i have to set any headers with the website request or is it perhaps not possible to load the data ?
Thanks for helping me with this issue
EDIT
[APPCONTEXT.service reportGetWebPageURL] // NSURL*
Cannot post images so this should help to understand the system.
UIWebView (Request to show Website1)--> Website1 (AJAX Request for data to show)--> Website2

Load web page in PhoneGap app

I'm using PhoneGap with AngularJS framework.
I want to display a web page. I tried to use iframe but scroll isn't working.
I want to keep this page inside my app and not as a in app browser or external browser.
My app is running on iOS, Android and WP8 both.
Some help please :)
Thanks in advance
function loadWebView(pid)
{
var url = "http://dummysite.com/index.php/catalog/product/view/id/"+pid;
$("#div_load_page").html('<object data='+url+' class="webview"/>');
};
This is simple jQuery I've applied in my phonegap application which gives me the desired result. Scroll bars are visible and depend on site's responsiveness and size.
See Result.

Titanium webview iframe doesnt seem to store cookies

I am developing an app using Appcelerators Titanium. The app consists of a webview. The webview shows i local page, iframe.html, and this iframe's src is pointed to a remote page.
However, this doesn't work out as i expected since it doesn't seem like the remote page can't store cookies when wrapped in an iframe. It works great on desktop and other devices. This seems to be an issue exclusive to iOS. I need the iframe, and i need cookies. What can i do to solve this?

iPad and iframe cookies

I am developing a Facebook canvas application using the iframe method, because of existing infrastructure the session data is set in a cookie between each page request (including jQuery JSON requests) this all works fine in Safari, Firefox, Chrome and IE( with the P3P header being set) but not in MobileSafari on the iPad (iOS 4.2).
I've been watching the debug as each page is loaded and it seems the session isn't being passed through as each page loads.
Does anyone know what it takes to get MobileSafari accepting cookies inside an iframe?
Thanks in advance!
Callum
One of my friends used this and said it worked
http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/
EDIT: updated link

Resources