开发者

How to get facebook page's stream with facebook-android-sdk

I followed steps here: https://developers.facebook.com/docs/guides/mobile/#android but I really don't get how use Graph API to get a Page's stream (only news) for Android.

Someone can make me an example? I cannot also find a real good exam开发者_运维百科ple online searching with Google...


There's a good Graph API explorer here, getting a page info is simple as using GET request with the page id.

https://graph.facebook.com/<PAGE_ID>    

So you can use the Simple Sample found here

//Page id for Bristol (my hometown) but could use something like 'cocacola'
String PAGE_ID="108700782494847"
mBristolPageButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
  //get the request aysn and process JSON response with the Listener
  mAsyncRunner.request(PAGE_ID, new MyPageRequestListener());
}
});

To get the feed/news from a page put /feed on the end [However you may require a auth_token to get news stream]

https://graph.facebook.com/<PAGE_ID>/feed
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜