开发者

Can a Web App launch a PDF in a Native App on the iPad?

As the title says, I have a web application that I run in Safari on my iPad that I would like to launch anot开发者_如何学Pythonher app (native to iPad) in order to edit a PDF.

Is this possible?

Thanks!


Where does the PDF live? If it is hosted online, accessible via a URL, I think you could make it work.

A web application can launch a native application if the native application has registered a custom URL scheme (via it's info.plist). But it's not directly possible for the web app to detect if the native app is installed.

Assuming the native app has a URL scheme registered, e.g. "myapp://com.mycompany.myapp" then the web app could launch it and pass the url to the pdf simply by navigating to a special url with the pdf url passed as a parameter:

myapp://com.mycompan.myapp?pdf=http://someserver.com/afile.pdf

You probably want to URL-encode the url to the pdf itself...


it's not an pure solution but maybe phonegap could allow you to open native applications.


I've implemented csv importing functionality into my app; by adding all those entries around CFBundleDocumentTypes to the Info.plist.

And if I open a csv-file in safari my app is available in the "Open with..." list. So if the app is able to edit pdf-files it should register itself as an editor of pdfs, and then it will show up if pdf files are opened in safari.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜