views:

142

answers:

2

Using stream.publish, I've tried the above by passing the application's id as the "uid" parameter, but it always gives me a "Permissions Error". I've ensured that the extended permissions for "publish_stream" are set to allow, but it still gives me this error.

Is it possible to make posts appear as if they came from the application?

+2  A: 

I had a similar problem to this. The easiest way to get your app to publish something is to use something like:

Facebook.streamPublish("I used this app")

This will prompt the user to update their status with the message "I used this app". This does not require any additional permissions and the final message contains a box saying it came via your app.

tim harrison
Thanks tim! This will definitely work, but in my scenario I will need to publish to the stream when a user isn't using facebook (updates to data via methods outside of facebook). I need my application to be able to push messages to the stream by itself. Is this possible?
Alex
It is counter to Facebook policies to pre-populate the user message for stream stories. See http://wiki.developers.facebook.com/index.php/Policy_Examples_and_Explanations/Stream_Stories
Pat James
A: 

This should work fine if the user has given you extended permissions for offline access (which you can ask for when you request stream publishing permissions as well). More about that here:

http://wiki.developers.facebook.com/index.php/Extended%5Fpermissions

Once the user has given you offline access, you'll get a session key that doesn't expire, and you can use that to make calls on their behalf.

DoryEx

related questions