Using this code I found, I am wanting to post a screenshot to facebook, ive no clue how to and ive made little progress apart from finding this code. Any help would be appreciated!!
local facebook = require “facebook”
– You must use your own app id for this sample to work
local fbAppID = “123456789abcdefghi” --fake
local function onLoginSuccess()
– Upload ‘iheartcorona.jpg’ to current user’s account
local attachment = {
message = “Just a description of the photo.”,
source = { baseDir=system.ResourceDirectory, filename=“iheartcorona.jpg”, 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