Media selectPhoto capturePhoto | Transition back to App

Hi,

I’m new at this so apologies for what is a probably an easy fix. I searched at length but couldn’t find a similar issue being reported.

On both media.selectPhoto and media.capturePhoto, I’m experiencing an issue right after the photo is selected or captured (after tapping “Use Photo”). Rather than immediately returning to the app, the native photo capture/select screen is transitioning in from the bottom of the screen. I see the app for a small fraction of a second when the photo capture/select screen is “re” transitioning back into view. Momentarily you think it didn’t register your selection and then it returns to the app.

This doesn’t occur on the simulator, only on the device.

Details:

Corona SDK Build 2014.2393

Device - iPhone 5S (iOS 7.1.2)

Code:

function onComplete (event) if ( event.completed ) then -- ... does a few things to scale and reposition the image end photo1New:addEventListener( "tap", menu.takePhoto1) photo1CameraRoll:addEventListener( "tap", menu.pickPhoto1) --selectPhoto (kept in a separate module) function T.pickPhoto1(event) if media.hasSource( media.PhotoLibrary ) then tempData.img1 = tempData.submissionID .."-img1.jpg" media.selectPhoto( { mediaSource = media.PhotoLibrary, listener = onComplete, destination = { baseDir = system.TemporaryDirectory, filename = tempData.img1, --tempData.submissionID .. type = "image"} } ) else native.showAlert( "Corona", "This device does not have a photo library.", { "OK" } ) end end --capturePhoto (kept in a separate module, same module where I keep the selectPhoto) function T.takePhoto1(event) tempData.img1 = tempData.submissionID .. "-img1.jpg" if media.hasSource( media.Camera ) then media.capturePhoto( { listener = onComplete, destination = { baseDir = system.TemporaryDirectory, filename = tempData.img1, type = "image"} } ) else native.showAlert("Corona", "Camera not found.") end end

Information from Xcode console at the time of events (capturing a photo):

Aug 31 18:41:20 JeremiahFls-iPhone kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 1
Aug 31 18:41:20 JeremiahFls-iPhone kernel[0] <Debug>: AppleH4CamIn::power_on_hardware
Aug 31 18:41:20 JeremiahFls-iPhone kernel[0] <Debug>: AppleH4CamIn::ISP_SelectBestMIPIFrequencyIndex_gated - channel: 0, index: 1
Aug 31 18:41:34 JeremiahFls-iPhone kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 0
Aug 31 18:41:34 JeremiahFls-iPhone kernel[0] <Debug>: AppleH4CamIn::power_off_hardware

Thanks in advance for the help.

Cheers,

Jeremiah

Can you post more code that I could copy/paste into a main.lua and build it?

Hi Rob,

Thanks for the quick reply. I’ve since made some other changes to the app while I was waiting on a reply and can no longer reproduce the issue.

I’m not sure which changes fixed it (especially since I started working on an entirely different part of the app) but if it happens again, I’ll send across a version of the code that can be dropped into main.lua file and tested.

Thanks,

Jeremiah

Can you post more code that I could copy/paste into a main.lua and build it?

Hi Rob,

Thanks for the quick reply. I’ve since made some other changes to the app while I was waiting on a reply and can no longer reproduce the issue.

I’m not sure which changes fixed it (especially since I started working on an entirely different part of the app) but if it happens again, I’ll send across a version of the code that can be dropped into main.lua file and tested.

Thanks,

Jeremiah