Nursing RSS Graffiti Avatar

2 Notes

New Facebook change breaks publishing. Here is a fix for every curious developer

Early this morning (morning in Stockholm at least :-) ) around 06:00 GMT, Facebook pushed an update on its platform, affecting RSS Graffiti publishing feature on all Fan Pages. We ‘ve been informed by our users about it, and soon came up with the solution to the mystery, developing and pushing a hot-fix for this issue.

Apparently RSS Graffiti was not the only application affected. Any application using the REST api to publish on facebook Fan Pages’ Walls has the same problem. Since then quite a few developers have asked us one way or another to help them circumvnet this issue, by explaining what was the change and how we fixed it. So here it goes:

After this modification by Facebook, in essense all of our users trying to publish on their Fan Pages, were getting an error indicating:

“Session user 0 does not have permission to post to page XXX as the page” error 200.

“0” (zero) in this error message, was there to indicate that there is no actual session user associated with the API call. Which up to … yesterday was absolutely acceptable, as session keys were not required to publish on a Fan Page.

What changed, is that Facebook now - we cannot know if this a temporary condition or a permanent change - requires a user’s session key to publish on Fan Page. The “0”  in the error above was the hint to help us guess that.

So in order to successfully call the “stream_publish” method of the rest API, you need to provide a user’s session key by setting the Facebook->api_client->session_key property.

And in order for that to work while the user is not logged in, the Facebook user has to have granted the “Offline Access” and “manage pages” permission on the application, so that the session key of the user is not expiring and usable even when he is offline and allowing access to his administered Fan Pages.

There you have it. You can then go on and call $Facebook->api_client->stream_publish to publish on the stream of your fan Pages.

If on the other hand you are using the graph api to perform the stream publishing, you will need:

  1. Request to be granted the manage Pages and offline access permission
  2. Request access_tokens for the pages by visiting: https://graph.facebook.com/me/accounts with the user’s access_token. This should return a list of Pages that they admin, along with valid access_tokens for each of these Pages. 
  3. You should then use these access_tokens to publish on behalf of each Page.

We hope this can save all of those that asked us, or are anyway affected by this issue, a few hours of their lives.

There is now an associated bug in the Facebook bug tracker:

http://bugs.developers.facebook.net/show_bug.cgi?id=13453

Replies

Likes

  1. steroids-uk-me reblogged this from rssgraffiti-status
  2. rssgraffiti-status posted this

 

Reblogs