Facebook - share photo via me/photos request has broken?

I have had this feature implemented in a number of my games. The code is pretty straightforward:

[lua]

 local attachment =

  {

   message = “Your image is now on your Facebook page!”,

   source = { baseDir=system.ResourceDirectory, filename=“image.jpg”, type=“image” },

  }

   facebook.request( “me/photos”, “POST”, attachment )

[/lua]

This seems to have broken in the last few days, I’m thinking maybe Facebook changed something? I get a response of  “Error: HTTP status code: 400”, facebook error code 5. This is from the app I’m working on and an old one that I know this worked on fine as recently as a week ago.

I am using the “publish_stream” parameter when logging in.

If I run the Facebook Sample app, with this code replacing the ‘post photo’ section, and making sure there is an image with the correct name in the Resource Directory, it fails. 

I was hoping this would be a temporary facebook issue but it’s still not working this morning :frowning:

Well I’m at my wits end with this - 99.9% sure it’s not my code. Anyone else who posts local images to facebook within their app having any luck?

I didn’t see anything on the Facebook developers blog. 

Rob

Hmm…something must have changed. Code that worked previously just, well, isn’t.

I have a valid access token, I can make normal posts to the wall, I can make posts with a remote image, but posting to me/photos just isn’t happening.

Nick, I’m having the same issues with response of  “Error: HTTP status code: 400”, facebook error code 5 for iOS.

​I can use the same code to post images to Android fine and also post a message fine on iOS and Android but no matter what I try I cannot post an image to Facebook via facebook.request( “me/photos”, “POST”, attachment ).  

Corona, it’s definitely broken for posting local photos on iOS.  Nick is right.  Needs fixing fast please as I can’t send my app for approval until fixed.

I can post messages both on iOS and Android and post a local photo on Android using the example code.

I even created a new Facebook app with different app ID.  Still the same.   “Error: HTTP status code: 400”, facebook error code 5 for iOS.

It’s not the setup in the Facebook developers page otherwise I wouldn’t be able to send a message on iOS or both message and local photo on Android.

I’ll check with Engineering, but according to the Facebook Graph API, the source needs to be a multi-part/encoded image and I don’t know how we are uploading the images.  All the examples show using URL’s of an already uploaded image so I couldn’t really determine what they want.

Do we know when this broke?  Was it a particular version of Corona SDK that worked and stopped?

Thanks

Rob

Actually in retrospect, can one of you go ahead and file a bug report.  Regardless if this is a Corona problem or a Facebook problem, we need to adapt to it.

Rob

It was working with any version of Corona up til about 10-14 days ago. Now it doesn’t matter which version I build with it doesn’t work, and apps that were built months ago also fail.

Okay, make sure to include that information in the bug report.  Post the bug report number back here.

Thanks

Rob

Bug Submission: 31671

I still have apps that were built with 2013.2100 that still post fine (before FB was a separate plugin). When I replace them with an app built with anything current (2014.2223) the same code will not post and I get the com.facebook.sdk error 5.

I’m also experiencing this problem.

I am also experiencing this same issue:

iPhone testApp[1408] \<Warning\>: Error: HTTP status code: 400

 Got a reply back from my bug submission saying the Issue has been fixed and will be available in daily build 2014.2225.

Fingers crossed :slight_smile:

As soon as it’s available I will test and post back results confirming if fixed.

Thanks Corona for fixing this :slight_smile:

Just to let everyone know that I have tested the latest daily build 2014.2228 and it has fixed the issue.  Without changing any code my app sent an image as expected to my Facebook photos via a screenshot.

That’s great. I’ve tried the latest daily build and it does work. What to do if I want use the stable/public release?

Also, I’m gettings this error in the iOS Simulator Log (public and latest build):
<Error>: HID: The ‘Passive’ connection ‘MyAppName’ access to protected services is denied.

Is this normal?

@frisky did you forget to change "MyAppName" to your actual real app name somewhere?

@frisky

That error appears when your settings>Facebook has your app turned off under ‘Allow these apps to use your account’.

Go into settings>Facebook and allow your app.

It might not work on iOS simulator, as I’ve never tried filling it from iOS, so I would possibly dismiss this error.