Open a file in an external App on iOs

You must Login before you can answer or comment on any questions.

Hi,

I know that in iOs I can register the file types my App supports using the CFBundleDocumentTypes key in the info.plist property list file. In an App I need to do the inverse process. I need to know if there are other apps that supports PDF files and open a file from my App in the target external App (ie Adobe Reader). I saw a lot of iOs apps that supports this functionality, like dropbox or google drive: in these apps I can select a PDF and open it in Adobe Reader (if installed on the device) or in any other app that support PDF. How can I manage this situation in Titanium? I searched in the api documentation but I didn't find anything to read a system list of registered provider app. Any idea?

4 Answers

hi,

you can use Ti.Platform.openURL to open file with installed app.

— answered 1 year ago by Mitul Bhalia
answer permalink
6 Comments
  • Thank you Mitul, but it's not what I mean. I want to open the file with a specific app, in this case adobe reader. If i use Ti.Platform.openURL I cannot do this, I cannot choose with which app open the file. I need to check if there are apps that have registered themself as PDF file provider, using the CFBundleDocumentTypes key. If you try dropbox or google drive for ios (iphone or ipad) if adobe reader is installed you can choose to open a file with that instead of the internal viewer.

    — commented 1 year ago by Salvatore Guarino

  • oh.....then i have not yet faced this situation so do not know but if there is no way to do this in titanium then you can create a native module to do that...

    what say...? :)

    — commented 1 year ago by Mitul Bhalia

  • I'm not able to create a native module because I'm not an Objective-C developer :) Do you think that titanium is not able to access to these ios system properties?

    — commented 1 year ago by Salvatore Guarino

  • Show 3 more comments

Hi Salvatore, i think your question is having good point and Titanium does not support this feature by default.

Using Native module approach it is possible and As you are not Objective C programmer , so take help from some body. Here is a helping code in stack overflow

I had the same problem and searched all over for "Open in" solutions in Titanium. The solution was simpler than I thought.

var docViewer = Ti.UI.iOS.createDocumentViewer({url:'Example.pdf'});
dockViewer.show({animated:false,view:btnShare});});
I'm using Titanium SDK 3.0.2

Your Answer

Think you can help? Login to answer this question!