开发者

facebook: how to grant a website permanent access to your wall?

I am creating a website and I would like it to display the posts present on the wall of my own Facebook profile page. These posts must be visible to any user visiting my site.

Having read various articles online regarding the topic of the Facebook api, I had thought I had found the correct solution. The following steps are 开发者_Python百科what I have done thus far:

  1. Signed in as a developer on Facebook (I am only allowed a max of 2 URLs in the post hence I have ommitted the URL)

  2. Set up a new app which gave me an App ID and an App Secret.

  3. Generated my access token at the following URL:

https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&scope=offline_access&client_id=APP_ID&client_secret=APP_SECRET

Where APP_ID and APP_SECRET are the App ID and App Secret from step 2. I also added the 'scope' parameter and set it to 'offline_access' as I believe this is what would allow my website to access my Facebook wall information without needing me to be currently logged into Facebook.

When I access my test page at [http://pauldailly.javaprovider.net/danceclass][1] (I set this URL to be my 'site URL' when creating my app in step 2. Similarly, I set my 'Site Domain' to be the same as my site URL, without the '/danceclass'). I get the information message 'Paul Dailly has not shared any information' and it displays my Facebook profile image. I should point out that this test page is using the Facebook Wall jQuery plugin to make the call to facebook. I have supplied the plugin my facebook page's profile ID and the access token that I generated above.

My question is, do I need to take some extra step in order to allow my site to now access specific pieces of data from my Facebook account, such as my wall posts, now that I appear to have a valid access token?


First, a access token can expire in many ways, 1. Time. 2. When you log out. 3. When you change permission etc.

Second, yes you need different permissions from the user (even if the user is app admin) to retrieve different bit of information from his Facebook profile.

And also, make sure you construct meta tag currectly in your website, like putting og:admins, og:app_id etc. You have to supply the app_id when initiating the facebook (php/js)-sdk in your website too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜