I am making a simple web application with HTML5 that uses "Javascript database" (websql as Apple now calls it) to store some HTML form entries.
When I access this app on Safari (in the iOS simulator), and use the Safari web inspector to debug it, the database is shown in the web inspector under "Resources". But when I add the app to the home screen, and then try to debug it using the Safari web inspector, the database isn't shown at all (but the others - the application cache, local storage, session storage etc. all show as usual).
Can someone tell me if there is any such limitations that iOS offline web apps (that can be added to the iPhone / iPad home screen) do not support javascript database / websql? Or if this is some kind of known bug with web inspector?
(No, I haven't coded it completely - so it would help me save some coding time if anyone can chime in and share your experience, especially if there are any other limitations with iOS web apps that developers in general should be aware of.)
(Mods P.S: Consider creating a "javascript-database" tag).
No, it appears that when an html page is "saved" to the home screen it is then rendered in a UIWebView - which does not support indexedDB (and I believe SQL DBs). When the page is rendered in Safari it's a WKWebView which does support indexedDB... So this is not even considered a bug.
I've been using localStorage to get around this, but performance is a little weak, and the size is severely limited (about 2.5mb in my tests)
Related
I have created an demo application in Titanium for ipad that contains just a single webview. And this webview loads a url that is large tool for drawing, scaling and other tones of features. Are there any chances of application getting rejected. As per my knowledge application containing just a webview would get rejected. If yes then is there any features that could be integrated which ensures that app doesn't get kicked off from app store.
Yes, its surely reject by the apple. If web pages are specifically design for the application and thats simple putting in your website into an application, then application will be accepted. You don't put such kind of application which AppStore that are't needed.
Web browser is access same content.
I am a Learning management system(LMS) administrator for e-learning courses. My LMS is loaded into a UIWebview of an iOS native app. In this scenario,
1) How could i make sure my e-learning courses always loads the up to date files and not from cache (i am not in control of iOS App)?
2) For iOS mobile safari browser there is a setting to clear 'cookies and data'. I use this option to clear cache/cookies to make sure the mobile safari browser loads the up to date contents. Is there a similar option available to clear the cache/cookies for websites loaded through UIWebview?
My target platform is iPad with iOS 6
Since apple's ios update to ios 6 data/local storage for Web Apps and Home Screen Apps is handled differently than before. Before ios 6 they shared the same data. Now home screen apps have their own data like native apps (see here: iO6 and Data Storage).
Since I have some trouble with the cache manifest in my home screen app (works fine in mobile safari, doesn't work right in home screen app – see here: strange behaviour with cache.manifest / offline usage of web app saved to home-screen on ipad ios6), I asked myself if it might no longer be necessary to store data for offline usage for home screen apps via the cache manifest. I searched the web without any luck.
So my question is following: is the cache manifest obsolete for home screen apps on ios 6? And if so, can I just leave it in there or do I have to remove it? Or: do I need to initiate offline storage somehow different now?
As I uderstand it the cache manifest was/is used to tell what data for a website should be cached so later visits would have decreased loading time AND the website could be used offline (either in mobile safari or as a home screen app). But if now the home screen app and the original website do not share the same data anymore – how is caching for home screen apps handled now?
I would be very happy for any advice/help on this. Or at least some links for some how-tos.
Thx!
You still need the manifest file just like before. In fact you should not change anything, your web app should work just like before.
The only difference is that now home screen web apps have their offline cached (and local storage) stored separately from web apps in the safari.
Before there was only one place. So, before, if you had your app open in safari and also as home screen web app, they will both share the same offline cache and localstorage.
Now, each has its own cache separate from the other.
I've been doing lots of work in getting a few web apps to work offline on iOS using the HTML5 manifest. I've ran across the typical problems everyone else has and fixed them and everything seems to be working fine—except in the case where I save the web app to the desktop on my iPhone 4.
If I do this and then enable airplane mode, I get the following alert when trying to access the app via the home screen: "your-app-name could not be opened because its not connected to the internet." Accessing the app via Safari browser works fine while offline.
If anyone knows if this is an error on my part, or even the slim possibility of a work around, do tell.
Even downloading the new Financial Times web app (very well done with extensive localStorage support) results in an error when accessing it offline from the home screen.
Technical specs: Running iPhone 4 with iOS 4.3.3 (but also saw the issue in 4.3.2)
After reading the comments (especially Rowan's) I ran more tests and found the answer:
No, Apple did not disable HTML5 offline capability for web apps saved to the home screen, it works - for the most part. There is a bug that will make it not work. It doesn't seem to have anything to do with your manifest setup (unless perhaps it downloaded a bad manifest or incomplete manifest at one point.) We don't know how widespread it is but the fix is to clear your Mobile Safari Cache.
Here's the steps:
Close the web app (make sure its not sticking around in the background).
Cleared Mobile Safari cache: Settings > Safari > Clear Cache
Reopened the app (for caching).
Close the web app again (make sure its not sticking around in the background).
Enabled "Airplane Mode": Settings > Airplane Mode
Reopened the app.
It should now work offline. If it doesn't then its probably a separate manifest issue in your app. Looks like a weird bug with the browser cache - or perhaps the cache was completely full? Who knows, but that's the answer. Thanks guys.
iOS seems to be very sensitive to load issues when offline.
I was getting your "could not be opened" error when offline on a page I was working on. The problem turned out to be that the page created an iframe pointing to a site that didn't have an AppCache. Removing those iframes fixed the issue.
In my case, I handled it using window.navigator.standalone which tells you whether you're running in an iOS homescreen app. The code looked like this:
if (!navigator.standalone) insertFrames();
add this to your html:
https://web.archive.org/web/20170201180939/https://jonathanstark.com/blog/debugging-html-5-offline-application-cache?filename=2009/09/27/debugging-html-5-offline-application-cache/
I found it massively useful - even though I've created my manifest file and compared it to other people's manifests this JavaScript debugging script gave me the clue I would have never found otherwise. I apparently had syntax error in my manifest ... long story short I had to remove everything and add the paths to each file/image one by one. The end result was the same however it worked... how weird!!! does whitespace / comments affect the syntax of the file?
I am developing an app for both BlackBerry and Android. On Android, when I send the browser to some url, it redirects to another url with good look. But on BlackBerry for the same url it is only displaying links on the site. It is not applying css and does not look like the Android layout.
Blackberry browser (specially in OS versions < 6) is not as good as the Android one. There are also a couple of options in the Browser Settings that you should enable for it to load JavaScript, Background Images or PC-targeted CSS files. Sadly, there seems to be no way of automatically passing this as a parameter to the browser before opening.
You're facing a platform issue, not a developer's one. Although you could, of course, create a set of CSS files intended for Blackberry visitors, taking these limits in mind and being conscious that it will not look as good as the Android one.