I’ve been using media.show to let the user select a photo, then I’m saving the photo on my app folder.
It works perfectly on non-iPad devices with this code:
media.show( media.PhotoLibrary, onComplete, {baseDir=system.TemporaryDirectory, filename="screenshot.jpg", type="image"})
I’m saving the image without showing it on screen.
Now, when I run it on iPad the media selector shows up in the top left of the screen, so I need to add the parameters origin and permittedArrows to put the media selector near the button.
And again, the code in the api works ok:
media.show( media.PhotoLibrary, { listener = sessionComplete, origin = myButton.contentBounds } )
But, how can I save the image without showing on the screen?
The docs say
media.show( media.PhotoLibrary, listener, file, origin, permittedArrowDirections )
But no matter what, when I add the file parameter, the origin/permittedArrow params stop working and the selector goes back in the top left position.
How am I supposed to do it?