views:

255

answers:

1

After authorize the current user to create an application with the createApplication function (http://wiki.developers.facebook.com/index.php/Facebook.createApplication)

I'm trying to publish streams on this new application page :

    $facebook = new Facebook(API_KEY,API_SECRET);
    $facebook->api_client->begin_permissions_mode(NEW_APP_API_KEY);
    $res = $facebook->api_client->stream_publish('Yeahhh'.date('H:i:s'), $attachment = null, $action_links = null, 
$target_id = NEW_APP_ID,$uid= NEW_APP_ID);

But it get this error : Application does not have permission for this action

What is wrong with this ?

Thx !

A: 

You either need to get extended permissions from the user to publish to their stream, or you have to use a pop-up each time.

Documentation here

Edit

Sorry - I rushed that one a bit. I think you need to omit the $target_id parameter.

This is from the documentation of stream.publish:

Note: If you specify a Page ID as the uid, you cannot specify a target_id. Pages cannot write on other users' Walls.

klochner
It is a post from "app" on the "app wall".I would understand if it was the user, but for the app ?
Tom
my apologies for not reading the question carefully.
klochner
No problem ;-) I tried to omit $target_id, but i get the same error...
Tom
It seems like you must set permissions via the dialog box, but only "pages" appears, you can't select applications. Maybe what I am trying is currently impossible to do...
Tom
Good to know, thanks.
klochner

related questions