大致步骤是:
1、在facebook 上 创建一个应用程序,可以获得App ID/API Key和App Secret。
2、使用URL:
其中YOUR_APP_ID就是你的APPID, YOUR_URL就是你应用程序的URL,Canvas程序就填Canvas的URI, scope就是请求的权限,token表示要返回 accessToken的值
这个界面进去就是跟国内的微博应用一样了,是一个申请用户授权的页面,用户点击授权后,facebook会这样请求你的YOUR_URL:
http://your_url#accessToken=xxxxxx
3、拿出accessToken密钥,通过下面的URI获取到用户信息
https://graph.facebook.com/me?access_token=xxxxxxx
4、各种API:
- Friends: https://graph.facebook.com/me/friends?access_token=...
- News feed: https://graph.facebook.com/me/home?access_token=...
- Profile feed (Wall): https://graph.facebook.com/me/feed?access_token=...
- Likes: https://graph.facebook.com/me/likes?access_token=...
- Movies: https://graph.facebook.com/me/movies?access_token=...
- Music: https://graph.facebook.com/me/music?access_token=...
- Books: https://graph.facebook.com/me/books?access_token=...
- Notes: https://graph.facebook.com/me/notes?access_token=...
- Permissions: https://graph.facebook.com/me/permissions?access_token=...
- Photo Tags: https://graph.facebook.com/me/photos?access_token=...
- Photo Albums: https://graph.facebook.com/me/albums?access_token=...
- Video Tags: https://graph.facebook.com/me/videos?access_token=...
- Video Uploads: https://graph.facebook.com/me/videos/uploaded?access_token=...
- Events: https://graph.facebook.com/me/events?access_token=...
- Groups: https://graph.facebook.com/me/groups?access_token=...
- Checkins: https://graph.facebook.com/me/checkins?access_token=...
转自:http://www.cnblogs.com/DreamCreator/archive/2011/11/15/2250023.html