Re: [PhoneGap] Running www from app NSDocumentDirectory in IOS

94 views
Skip to first unread message

Shazron

unread,
Dec 11, 2012, 7:36:26 PM12/11/12
to phonegap
With this patch (in 2.3.0) you can specify any URL as your startPage: http://issues.cordova.io/1475
In your case, pass the file:// url

To get the file URL of the www folder, just query document.location when in the index.html page.

On Wed, Dec 5, 2012 at 1:28 PM, Michael Richey <richey...@gmail.com> wrote:
I've done this before, in another app (not PhoneGap) which is basically a glorified PDF reader.  It ships with an PLIST describing the table fo contents for the app menu, and the PDF document.  When the app launches, it copies this PLIST and PDF into the NSDocumentDirectory and loads them.  When updates to the document occur, the app downloads them, replaces the existing PLIST and PDF, then reloads the view.  It's fast, efficient, and reserves app updates for bugfixes.

I'd like to do something similar with the new app I'm writing with PhoneGap/Cordova.  

Mostly, my need is to have the ability to append information into the www directory - but an added bonus would be the ability to update the www directory in its entirety.  This is my thought:

1. app launches - copies www to NSDocumentDirectory
2. UIWebView loads from NSDocumentDirectory instead of app bundle.
3. User selects options within the app causing additional material to be downloaded into www within NSDocumentDirectory
4. App update causes entire www to be rewritten within NSDocumentDirectory

My question is, what exactly do I copy?  And what is it?  I've found a line in CDVCommandDelegateImpl.m which seems to indicate a single file named "www" contains the contents of "www" in some form of archive, but I haven't determined what type of archive that is yet.

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
 
 

Reply all
Reply to author
Forward
0 new messages