如何让Facebook页面的数据流与Facebook,Android的SDK [英] How to get facebook page's stream with facebook-android-sdk

查看:156
本文介绍了如何让Facebook页面的数据流与Facebook,Android的SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我也跟着步骤这里: https://developers.facebook.com/docs/导游/移动/#机器人 但我真的不明白怎么使用图形API来获取页面的流(仅消息)为Android。

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 example online searching with Google...

推荐答案

有一个很好的图形API浏览器这里,得到一个页面的信息是简单,只要用与页ID GET请求。

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>    

所以,你可以使用简单的示例发现这里

//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());
}
});

您可以通过把/饲料喂结束[但是你可能需要的auth_token得到消息流]页进/新闻

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

这篇关于如何让Facebook页面的数据流与Facebook,Android的SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆