views:

63

answers:

2

I created and application in facebook (it's in "sandbox mode"). I added a "connect to facebook" button in a page. The login works OK, but when I try to use the method stream_publish, I get that error :

Uncaught exception 'FacebookRestClientException' with message 'The user hasn't authorized the application to perform this action' in 

I noticed that when I log in, it doesn't say "Publish content to your Wall" in the login popup. I see that when I log in on digg.com with the facebook connect button, but I don't see that in my app.

So do I need to set some kind of settings in my application settings... Is there another of login a user that will grant my application to post data on his stream?

Update #1

This is the line I use to edit my stream :

$this->facebook_connect->client->stream_publish($message,null,null,XXXXXX,XXXXXXXX); Where XXXXXXX is my user id on FB.

Update #2 When I log in my profile on FB, go to "Account", "Application Settings", "Edit settings" on my application, I don't see the "Publish content to my Wall" as in the "Events" application...

A: 

You have to have the publish_stream permission in order to publish to the stream. I know that sounded obvious, but in order to get this permission, and other extended permissions, you have to specifically request them. I don't know exactly how to do this with PHP, but these links might help:

Extended Permissions

Authentication (see the section "Requesting Extended Permissions")

PHP SDK Tutorial

Ryan Kinal
yea I saw that "publish stream" permission somewhere. it's just that the facebook API DOC is SO clear (sarcasm). Thanks, I'll take a look at those pages!
mrmuggles
A: 

Abra kadabra

$session = $facebook->getSession();
$loginUrl = $facebook->getLoginUrl(
        array(
        'canvas'    => 1,
        'fbconnect' => 0,
        'req_perms' => 'publish_stream'
        )
);

Source : http://thinkdiff.net/?p=1767

Robus
looks like a great tutorial. I'll take a look at this one too! Thanks a lot! I was using the REST api, I guess it's outdated...
mrmuggles
To remove the "iframe" type of app, just remove the "canvas" parameter.. It works great, thanks :)
mrmuggles