Opening files / sending to other apps

Hi,

I have PDFs and Word Docs in my Apps (iOS) directory - how do I open them? Using a web popup wth a file:// url ? I have seen other apps (including Safari) ask “Open in…”?

This is kind of an urgent issue for me, because if I can’t display some of these filetypes my App will be essentially useless and it will be back to XCode :frowning:

–Maarten [import]uid: 5822 topic_id: 12448 reply_id: 312448[/import]

that was fixed in the daily builds. - if you are a subscriber you should be able to have file:// [import]uid: 24 topic_id: 12448 reply_id: 45463[/import]

I am, I think that’s where I saw it then. Couldn’t find it for the lie of me.

Thanks for the great product, and being a great team! Those $$ are well spent. [import]uid: 5822 topic_id: 12448 reply_id: 45472[/import]

(from which build onward, btw. Just looked at the summaries and couldn’t find it that quickly).

So: iOS, open Web popup with file:// and …voila? Grat hving daily builds, BTW. I like the new widgets too. [import]uid: 5822 topic_id: 12448 reply_id: 45474[/import]

several builds ago.

dont know the api really well - let me ask one of the engs

c. [import]uid: 24 topic_id: 12448 reply_id: 45476[/import]

this only works on android right now and the adobe reader must be installed
[import]uid: 24 topic_id: 12448 reply_id: 45486[/import]

Ouch, no way to do that on iOS? I’d hoped that web popup -> Safari -> builtin viewers would be the path to success.

Any chance to get it in - I’d have to rewrite my whole project in Xcode. Should have checked on this feature earlier :frowning: [import]uid: 5822 topic_id: 12448 reply_id: 45489[/import]

i think you can do it via webpoup

you will need to pass in a file://

i think that should work

c [import]uid: 24 topic_id: 12448 reply_id: 45490[/import]

I’ll try tomorrow and report back. For docs and the community, or a feature request :wink: [import]uid: 5822 topic_id: 12448 reply_id: 45492[/import]

Carlos, for iOS can we get the QuickView component, that will display the appropriate options and associated apps to open a file with, so that way the file could be transferred to another app for opening.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 12448 reply_id: 45536[/import]

Tested it with a PDF - works fine but the width, height are ignored. Other formats such as .doc don’t work. Also, there is now way to close the web popup, or should I do that via a Runtime event listener?

So I’ll add a feature request in the appropriate forum for the quick-view component. Media files are of course well supported by Corona already…

Cheers,

Maarten [import]uid: 5822 topic_id: 12448 reply_id: 45583[/import]

Regarding the closing of web popups.

If you make the web popup NOT fullscreen, you can add a button and call: native.cancelWebPopup()

That will close the web popup.

For fullscreen web popups, refer to the example on this page:
http://developer.anscamobile.com/reference/index/nativeshowwebpopup

But using that method, you’ll need your web popup to navigate to a specific (non http) URL that you specify (such as “corona:close”), so if you’re opening a PDF, you might have to make it not quite fullscreen and just use the button method. [import]uid: 52430 topic_id: 12448 reply_id: 45740[/import]

Once it’s a PDF, width and height in the options table seem to be ignored - it just enters fullscreen mode???
[import]uid: 5822 topic_id: 12448 reply_id: 45745[/import]

Actually, just tested with a simple HTML fine which dispays fine, but:

  • scaling on the device is handled by the native web pop up
  • x,y,width,height are all ignored (iPhone 4, 4.3.3)

Can anybody either confirm that or show a sample of a Corona web popup that is not fullscreen with a working HTML file? [import]uid: 5822 topic_id: 12448 reply_id: 45906[/import]

Hi Maarten,

This post is over 6 months old I know, but have you ever found a solution for this ?

I do have this running in the app I’m currently developing, although only tested on device running iOS. I would imagine it’d work fine on Android as well since I’m using an html template to embed the pdf file…unless safari mobile comes with a pdf reader plugin, and the default Android browser doesn’t…

I’d be happy to share it ! [import]uid: 23043 topic_id: 12448 reply_id: 81295[/import]

Nope, and I think you will make a LOT of people happy if you share it or can write a quick doc on how to do it!

Cheers, Maarten [import]uid: 5822 topic_id: 12448 reply_id: 81855[/import]

Here is the link with instructions and the git repo URL to download a functional project example,

Make sure to read the “LIMITATION TO DISPLAYING PDF FILES USING THIS METHOD” section though!

Cheers! [import]uid: 23043 topic_id: 12448 reply_id: 81890[/import]

Any chance of posting that link again? I am not seeing it [import]uid: 7863 topic_id: 12448 reply_id: 97185[/import]