2

Scenario: While logged into facebook, I click on a share link on my site. It pops up the dialog to post to my timeline.

Question: Is it necessary to create an app to do this? Or does facebook offer an app that will request permissions to do this for you?

My current plan is to use the facebook graph API with the php sdk to ask for the proper permissions, build the timeline POST request with an access_token. I just wasn't sure if there was an easier way to do this. Thanks!

Fostah
  • 2,947
  • 4
  • 56
  • 78

1 Answers1

2

Graph API is all that you need. Your server needs to support OAuth 2.0 authentication.

Add the URL of the script that handles this in the configuration page of your FB app.

Request for an access_token with offline_access permission. (offline_access allows you to post to user's timeline even when he is not logged on). With the access_token, do a HTTP/POST with params message and access_token to https://graph.facebook.com/me/feed as shown here.

NOTE: FB is deprecating offline_access from May 1, 2012. Check this.

UltraInstinct
  • 43,308
  • 12
  • 81
  • 104