kverweij / stagewebviewbridge

Automatically exported from code.google.com/p/stagewebviewbridge
0 stars 0 forks source link

Loading content from File.documentsDirectory in iOS? #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm trying to use the UIFileSharingEnabled to add my local files to my app. 
However, when I try to load them using 
webView.loadLocalURL("appfile:/index_scroll.html"); it is not working. Is this 
something that can be done with the StageWebViewBridge class?

Thanks for your time!

Original issue reported on code.google.com by col...@gmail.com on 13 Oct 2011 at 8:36

GoogleCodeExporter commented 8 years ago
Hi,

The docs are not updated, but you can do it this way:

webView.loadLocalURL("doclink:/index_scroll.html");

Attention, when you call the methods for loading ( loadLocalURL, 
loadLocalString , etc ) you must use the next protocols:

applink:/
doclink:/

When you refer some file inside by example an html file you must do it this way:

<img src="appfile:/file.png">

Anyway, by now, you can load an html file located in the documentsDir, but you 
can not refer by example images inside the documentsDir...

This will be a future update.

Original comment by xperime...@gmail.com on 13 Oct 2011 at 10:08

GoogleCodeExporter commented 8 years ago
Fixed in the latest revision, now you can reference files in the documents dir 
as docfile:/

Original comment by xperime...@gmail.com on 20 Jan 2012 at 3:18