This is a migrated thread and some comments may be shown as answers.

Open file in another app

3 Answers 60 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paul
Top achievements
Rank 1
Paul asked on 22 Jul 2013, 05:35 PM
Hi,
  1.  Is there a way in which I can do the following, once I have downloaded a file to the local application storage (I know how to do this),  Then click a button that will popup the menu showing other apps that file can be opened in?

To basically do the following and having A menu prompting the user only to open it using another app.http://developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/PreviewingandOpeningItems.html#//apple_ref/doc/uid/TP40010410-SW1

2. Also how can I once I have downloaded an image save it to the photo library. I have seen some posts here where people have asked it but no real answer on if it can be done. Most of your responses are about how to download a file but nothing about how to save it the phones photo library so that it will show up in the gallery.

Thanks
Paul

3 Answers, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 22 Jul 2013, 08:48 PM
Ok I have managed to achieve open in another app by creating a custom plugin which works really well. All I do now is pass the url and the file type to the plugin and IOS will download the file and popup a menu showing all the apps installed that have that file type associated with them.

So still need 2 answering or is that only possible via a custom plugin too?
0
Accepted
Steve
Telerik team
answered on 23 Jul 2013, 01:51 PM
Hello Paul,

There is already an existing plug-in for #1: ExternalFileUtil.

About your second question, there is currently no Cordova support for saving existing images to photo gallery. You would have to use a plug-in for this purpose, here is one https://github.com/grnadav/SaveToPhotoAlbumPhonegapPlugin.

You can find more information on Custom plug-in in Icenium in the following links:


Regards,
Steve
Telerik

Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Paul
Top achievements
Rank 1
answered on 23 Jul 2013, 03:40 PM
Hi Steve,
               Yeah I used ExternalFileUtil and slightly modified it a little so all I had to do is pass in filepath and file extension instead of having to pass in the uti. So I made this change which will automatically lookup the correct uti based on what ever extension is passed in. for instance png will map to public.png saves me having to know all the uti's.
    NSString *uti = (NSString *)UTTypeCreatePreferredIdentifierForTag(
                              kUTTagClassFilenameExtension,
                           (CFStringRef)[arguments objectAtIndex:1], NULL);

I will take a look at SaveToPhotoAlbumPhonegapPlugin, so thank for pointing me in that direction.

I have to say I love the fact you can edit these .h and .m files directly in icenium, the icing on the cake would be intellisense for these types of files too but can live without it.

Thanks
Tags
General Discussion
Asked by
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Steve
Telerik team
Share this question
or