I am trying to send a screenCap to facebook, it is saving the screenCap but how can i get the latest screenCap’s url ? source = { baseDir=system.ResourceDirectory, filename=" screenCap ",
[code]
local facebook = require “facebook”
local fbAppID = “—”
local screenCap = display.captureScreen( true )
local alert = native.showAlert( “Success”, “Screen Capture Saved to Library”, { “OK” } )
local function onLoginSuccess()
– Upload ‘screenCap’ to current user’s account
local attachment = {
message = “Just a description of the photo.”,
source = { baseDir=system.ResourceDirectory, filename=" screenCap ", type=“image” }
}
facebook.request( “me/photos”, “POST”, attachment )
end
– facebook listener
local function fbListener( event )
if event.isError then
native.showAlert( “ERROR”, event.response, { “OK” } )
else
if event.type == “session” and event.phase == “login” then
– login was a success; call function
onLoginSuccess()
elseif event.type == “request” then
– this block is executed upon successful facebook.request() call
native.showAlert( “Success”, “The photo has been uploaded.”, { “OK” } )
end
end
end
– photo uploading requires the “publish_stream” permission
facebook.login( fbAppID, fbListener, { “publish_stream” } )
[/code] [import]uid: 225288 topic_id: 36255 reply_id: 336255[/import]