I'm using the fb_graph gem in a Rails 3.1 app. I'd like for users to be able to post links to their Facebook wall from my site. Here's my code that posts the link:
me = FbGraph::User.me fb_token
me.feed!(
:message => message,
:link => link_url,
:name => link_name,
:description => link_description
)
At first glance, this works great. The link is posted to the user's wall and the user's message and the link description appear perfectly.
The problem is that only links back to my site work. If a user clicks a link on their facebook wall that happens to go to another site, then they see a facebook error that says:
An error occurred with my-app-name. Please try again later.
During authentication, I'm requesting publish_actions and publish_stream. Is there another permission that I'm missing? Or could the problem be that my FB app is not setup propertly or I'm not posting the link in the correct way? Any assistance is greatly appreciated!
Thanks!
Ok, I found a workaround to this issue. Instead of using the feed! method, the link! method works perfectly:
me.link!(
:message => message,
:link => link_url,
:name => link_name,
:description => link_description
)
This isn't an entirely satisfying answer to the question because it's more of a workaround, but I figured I'd throw this out there if anyone else runs into the same issue.
If anyone has an answer to the actual problem to my original question, I'll gladly switch the correct answer!