On iPhone OS 2.2.1 and 5.0.1, both in the simulator and on the device, when opening data: url works fine in UIWebView , but using openURL does exactly nothing.
And Safari will gladly and properly display such a URL if you want to enter it in the navigation bar, so this is clearly a problem with sharedApplication openURL , not Safari.
If the base64 string is short enough (maybe less than 2K), you can bind it as a request parameter to the http url, which simply returns a redirect to the data url. Then you can use openURL to open the http address. Yes, it means jumping over some server, but it will work.
Alternatively, since Safari obviously didn’t, you can tell iPhone that your application is a data schema processor : and be responsible for delivering content to UIWebView. However, this is likely to fail in the future. :-)
Where is the data url located first? Perhaps you can create a web page with a content of no more than <iframe src="<the data url>"/> and use OpenURL again at that URL.
ddoughty Mar 22 '09 at 3:29 2009-03-22 03:29
source share