Hi all,
I've been implementing Facebook Connect into a site and am using both the PHP API, to allow me to automatically post data to a user's wall, as well as the JS API, for manual posting, permissions dialogs, etc. When the user uses the manual method it works 100%...the popups are displayed correctly, and the data gets posted to their wall properly. However, when I try to use the PHP API I am getting inconsistencies.
When I try posting automatically using the PHP API using one account it works perfect, every time. But for some other accounts it never works, always returning "Permissions error." The error code is 200, and I've checked the Facebook API documentation and it's pretty vague, saying only "Permissions error. The application does not have permission to perform this action." But that's not true, since it works on some accounts and doesn't work on others.
First, I've made sure that the users in question have enabled the extended permission "publish_stream" and that the manual method using the JS API works, so it doesn't seem to be a problem with those specific permissions. There are no apparent differences between the Facebook accounts I've used.
So my question is has anyone run into this problem and found a solution to it? Is there some sort of other permission setting that users must enable for this to work? I've been searching Google and these forums but have not found any solution.
The request I am sending is: (Note: The content/image url/link url are not the actual data I use)
$attachment = array(
'caption' => '{*actor*} commented on <title> "<comment>"',
'media' => array(
array(
'type' => 'image',
'src' => 'http://www.test.com/image.jpg',
'href' => 'http://www.test.com'
)
)
);
$Facebook->api_client->stream_publish('', $attachment);
Thanks, Sarah