I’m trying to add a Share Screenshot button to my game, however, I can’t get the social popup to work. When the button is pressed, I save an image via display.save, then wait 100ms and bring up the social popup. But when I click an option from the popup (such as email, text, dropbox, etc) nothing happens. The popup just goes away. I don’t see any error messages in logcat or anything.
Here is my code
local stage = display.currentStage display.save( stage, "image.png", system.DocumentsDirectory ) timer.performWithDelay(100, function() local listener = {} function listener:popup( event ) print( "name: " .. event.name ) print( "type: " .. event.type ) print( "action: " .. tostring( event.action ) ) print( "limitReached: " .. tostring( event.limitReached ) ) end native.showPopup( "social", { listener = listener, image = { { filename="image.png", baseDir=system.DocumentsDirectory }, }, }) end)
I also tried sharing an image that was bundled in the resource directory, and still nothing happens. If I set a message instead of an image, it does appear to work.
This popup seems to work fine in another Corona made app called Bubble Toad, so I know that it is possible.
Thanks