问题
Been receiving this error when trying to post on a feed. I am using JavaScript to post. The ByteArray data is coming from a .swf
API Error Code: 100
API Error Description: Invalid parameter
Error Message: picture URL is not properly formatted
Here is my AS3:
var bdToSave:BitmapData = new BitmapData(s.width, s.height);
bdToSave.draw(s, null, null, null, null, true);
var encoder:JPGEncoder = new JPGEncoder();
var byteArray:ByteArray = encoder.encode(bdToSave);
if (ExternalInterface.available) ExternalInterface.call("publishStream", byteArray);
Here is my JS:
function publishStream(person)
{
FB.ui({
method : 'feed',
name: 'I just painted my face!',
caption: 'From the show Warren, using the True Colors: Face Painting App I painted my face to match my favourite team!',
link: 'https://www.facebook.com/fanunitednet',
description: '',
picture: person
});
}
I am sending it a byte array of data. Is it possible to get it working using that or do I need a URL? My issue is that I'm taking a picture, sending the bytearray of data to the form and then trying to use that picture.. there is no direct link.
Thoughts?
回答1:
You need to upload the image via the Graph API first, for example like it's described here:
https://developers.facebook.com/docs/graph-api/reference/user/photos/#publish
This mean via a POST request to /{user_id}/photos as multipart/form-data mime-type, and the byteArray as source parameter.
Remember that you need the publish_actions permission to be able to do this!
来源:https://stackoverflow.com/questions/21589152/facebook-api-100-error