Using latest daily build 2014.2231
So since Corona fixed the posting local image to Facebook I thought I was all set to release my app. Unfortunately not it seems as there is a horrible bug that happens all the time whilst posting a message, image link or local image. I know that everything is set up good because it will eventually post. This is for iOS. Here is the flow whilst trying to post an image link as per the example:
FaceBook Flow:
App Deleted from iPhone
FaceBook App newly Installed and logged in and made sure that my game is not setup in settings>apps via browser. i.e. a new install as a new user of my app would see.
Logged in to facebook via Settings
Reinstall App
Image Link Test
Press Login to Facebook > Logged in is true
Press Upload to Facebook>
Error: HTTP status code 400 on console
Error: The operation couldn’t be completed. (com.facebook.sdk error 5.) on iPhone
Press upload to Facebook again>
My game would like to access your basic profile info and list of friends
Press OK
Error: The operation couldn’t be completed. (com.facebook.sdk error 5.) on iPhone
Press upload to Facebook again>
My game would like to post publicly on your behalf
Press OK
Success! Your image link has been posted to Facebook
Posting is then successful from here on in.
I can’t release my app having new users see this mess once they try to post their first image.
[lua]
local function fblistener(event)
if event.isError then
alert = native.showAlert( “ERROR”, event.response, { “OK” } )
else
if (event.type == “session”) and (event.phase == “login”) then
local attachment = {
name = “Developing a Facebook Connect app using the Corona SDK!”,
link = “http://www.coronalabs.com/links/forum”,
caption = “Link caption”,
description = “Corona SDK for developing iOS and Android apps with the same code base.”,
picture = “http://www.coronalabs.com/links/demo/Corona90x90.png”,
actions = json.encode( { { name = “Learn More”, link = “http://coronalabs.com” } } )
}
facebook.request( “me/feed”, “POST”, attachment )
elseif event.type == “request” then
if ( not event.isError ) then
alert = native.showAlert(“Success”,“Your request for help has been sent to Facebook.”,{ “OK” })
else
local response = json.decode( event.response )
alert = native.showAlert(“Facebook Error”,response,{ “OK” })
end
end
end
facebook.login( appid, fblistener,{“publish_actions”} )
[/lua]