send screenCap to facebook

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]

Hi there,

Try using the display.save() function, which takes a display group and saves it to a file and directory. You could then use that in loading to file to post to Facebook.

(Note that you will only be able to save the file to the documents directory, temporary directory, or caches directory, not the resource directory. So your line 11 should use the same directory as where you save the image.)

Hope this helps!

  • Andrew [import]uid: 109711 topic_id: 36255 reply_id: 144096[/import]

Hi there,

Try using the display.save() function, which takes a display group and saves it to a file and directory. You could then use that in loading to file to post to Facebook.

(Note that you will only be able to save the file to the documents directory, temporary directory, or caches directory, not the resource directory. So your line 11 should use the same directory as where you save the image.)

Hope this helps!

  • Andrew [import]uid: 109711 topic_id: 36255 reply_id: 144096[/import]

Hi there,

Try using the display.save() function, which takes a display group and saves it to a file and directory. You could then use that in loading to file to post to Facebook.

(Note that you will only be able to save the file to the documents directory, temporary directory, or caches directory, not the resource directory. So your line 11 should use the same directory as where you save the image.)

Hope this helps!

  • Andrew [import]uid: 109711 topic_id: 36255 reply_id: 144096[/import]

Hi there,

Try using the display.save() function, which takes a display group and saves it to a file and directory. You could then use that in loading to file to post to Facebook.

(Note that you will only be able to save the file to the documents directory, temporary directory, or caches directory, not the resource directory. So your line 11 should use the same directory as where you save the image.)

Hope this helps!

  • Andrew [import]uid: 109711 topic_id: 36255 reply_id: 144096[/import]