views:

2785

answers:

3

Hi, I've made a simple Web Application for the iPhone, it's just 6 pages each with an image on it and I use the Cube transition to switch between them, all static content.

I need this to work on an iPod Touch offline, i.e. visit it once, disconnect from WiFi, and then be able to browse the static site.

I'm trying to do this using the HTML5 manifest feature, but I'm clearly doing it wrong?

My Manifest file:

CACHE MANIFEST
index.html
main.css
main.js
Images/Appointments_Page.png
Images/backgroundStripes.png
Images/button.png
Images/button1.png
Images/button1_clicked.png
Images/button2.png
Images/button2_clicked.png
Images/button3.png
Images/button3_clicked.png
Images/button_clicked.png
Images/CloseIcon.png
Images/CloseIcon_pressed.png
Images/Efficacy_Page.png
Images/EfficacyGraph_Page.png
Images/Graph_Icon.png
Images/GraphIcon.png
Images/GraphIcon_pressed.png
Images/Home_Page.png
Images/Tolerability_Page.png
Images/TolerabilityTable_Page.png
Images/WebClipIcon.png
Parts/ButtonHandler.js
Parts/PushButton.js
Parts/setup.js
Parts/StackLayout.js
Parts/Transitions.css
Parts/Transitions.js
Parts/utilities.js

top of my HTML file

<!DOCTYPE HTML>
<html manifest="cache-manifest">
+3  A: 

Hey I figured it out, leaving answer here in case it helps anyone else.

The problem I was having was that our server (IIS6) was refusing to serve my manifest file.

I had to add the MIME type ".manifest" using "text/cache-manifest".

Since then it's been caching fine, all 40+ files ranging from 1kb to 200kb.

Hope this helps.

Shahin
Hmm... this bit of code could prove useful. Thanks for posting it :)
rpetrich
Official info here: http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/Client-SideStorage/chapter_10_section_2.html
Kristof Neirynck
+4  A: 

I also wrote some tips on using the Manifest at: http://wecreategames.com/blog/?p=210

Other things to note: You need to reload the app TWICE to get the manifest's new contents, and you need to change the actual content of the manifest to force reloading the containing pages (I do this by changing a comment #v.03 to #v.04, or something similar).

JayCrossler
A: 

As a note: Apple suggests:

"The HTML file that declares the manifest file ..... is automatically included in the application cache. You do not need to add it to the manifest file."

(http://developer.apple.com/safari/library/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/OfflineApplicationCache/OfflineApplicationCache.html#//apple_ref/doc/uid/TP40007256-CH7-SW2)

So it would work with leaving "index.html" out of the manifest list.

Tom