Does anyone know how to share a screenshot on Facebook? I used this code before Graphics 2.0 and it worked just fine, but not what I’m using post 2.0, it seemed to stop working. Assuming I’ve set up my build.settings file up correctly with the FB ids, is there something wrong with my code below?
local function onLoginSuccess() local screenshotDirectory = system.DocumentsDirectory local screenshot = "ss\_"..os.date("%Y%m%d%H%M%S") .. ".jpg" display.save(group, screenshot, screenshotDirectory) local attachment = { message = "I need help! Do you know the name of this puzzle in "..\_APPNAME.."? "..\_HASHTAG, --source = { baseDir=system.ResourceDirectory, filename="background.jpg", type="image" } source = { baseDir=screenshotDirectory, filename=screenshot, type="image" } } facebook.request( "me/photos", "POST", attachment ) end -- login to facebook and post something local function fbListener( event ) if event.isError then native.showAlert( "Facebook ERROR", event.response, { "OK" } ) else if event.type == "session" and event.phase == "login" then -- login was a success; call function onLoginSuccess() --native.showAlert( "2", "2", { "OK" } ) elseif event.type == "request" then -- this block is executed upon successful facebook.request() call native.showAlert( "Facebook Post Successful!", "This puzzle has been uploaded to Facebook. Your friends should help you soon!", { "OK" } ) end end end local fbAppID = \_FACEBOOKID --not fake facebook.login( fbAppID, fbListener, { "publish\_stream" } )