I am trying to add an image on Facebook , but when i post it , i can see a BLANK image instead of
the actual image. I can see the discription, and if i upload three different size images i can see three different size Black images .
I am using JPG image , i followed blog :- http://blog.anscamobile.com/2011/12/uploading-photos-to-facebook-in-corona/comment-page-1/#comment-7258
I tried PNG images also but not working. And i am using Corona BUILD 767. I have a provisioning profile whose ID I am using.
here is my code :-
[lua]local facebook = require “facebook”
local bkgrnd = display.newImage(“globe_east.png”)
– You must use your own app id for this sample to work
local fbAppID = “285660044794607”
local function onLoginSuccess()
– Upload ‘iheartcorona.jpg’ to current user’s account
local attachment = {
message = “test user”,
source = { baseDir = system.DocumentsDirectory, filename=“inu.jpg”, type=“image” }
}
native.showAlert( "Log IN " , “Attachment is done Dipak” , { “OK” } )
– facebook.showDialog( {action=“stream.publish”} )
facebook.request( “me/photos”, “POST”, attachment )
native.showAlert( "Log In " , “Inside some logic” , { “OK” } )
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
native.showAlert( "Log IN " , “Login is done Vedangi” , { “OK” } )
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
function addImage()
local ImgGroup = display.newGroup()
local Img1 = display.newImage(“inu.jpg”)
ImgGroup:insert(Img1)
local baseDir = system.DocumentsDirectory
display.save( ImgGroup ,“inu.jpg”, baseDir )
– photo uploading requires the “publish_stream” permission
facebook.login( fbAppID, fbListener, { “publish_stream” } )
end
addImage()[/lua]
Please any one can help ?
Thanx Vedangi. [import]uid: 95790 topic_id: 23883 reply_id: 323883[/import]
[import]uid: 95790 topic_id: 23883 reply_id: 96491[/import]
The issue was i was using Documents Directory when i changed it to resource directory images were visible