Hi All-
I am trying to make it so that when a user goes to share their score (through the iOS native share menu), a screenshot is taken prior to the share menu opening so that an image of the screen (with the score) can be posted/shared.
However, for some reason the screenshot is not working at all when trying to post. I am able to get a normal image (already established in the file structure to work), but not a screenshot. I have read through all the documentation and have tried many different options, however I have not been able to get one working.
Here’s my code:
local popupListener = {} function popupListener:popup( event ) print( "(name, type, activity, action):", event.name, event.type, tostring(event.activity), tostring(event.action) ) end local itemsToShare = { { type = "image", value = { filename = "screenshot", baseDir=system.ResourceDirectory } }, { type = "string", value = "textline1" }, { type = "string", value = "textline2" }, } local options = { items=itemsToShare, listener=popupListener } local social\_share = display.newImage( "share.png" ) local function shareTap( event ) display.captureScreen( true, { filename="screenshot", baseDir=system.ResourceDirectory } ) -- I have also tried to execute the popup on a delay to allow the screenshot to "process", however that did not work either native.showPopup( "activity", options ) return true end
Thanks–