新闻提要从Facebook墙上一个Android应用 [英] news feed from facebook wall to a android app

查看:179
本文介绍了新闻提要从Facebook墙上一个Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法让过去后的作出一个Facebook的墙上成Android应用程序?我想要做一些像一个RSS阅读器来获得对应用程序的一些信息。

There is any way to get the last post's made on a facebook wall into a Android app? I want to make some like a RSS reader to get some information on the app.

要更好地解释 -

我在Facebook的网页约一足球俱乐部,并在那里我发布有关新闻,游戏等多种信息,现在我已经取得了一个Android应用程序,我的问题是,我是否可以导入后到Android应用程序?

I have a page on facebook about one football club and there I post several information about news, games etc. Now I have made an android app and my question is whether I can import the post into the android application?

推荐答案

当然,你可以。首先,如果你是新来的Facebook集成 - 读了android整合,登录/授权调用其API等(不复杂的话)的基础知识。

Of course, you can. First of all, if you are new to facebook integration- read the basics of the android integration, login/authorization calling its APIs etc. (not complex at all).

Facebook提供大量的API(不同的功能),它使用 访问令牌

Facebook provides many APIs (for different functions) that uses the access token.

根据您的要求,你只需要使用API​​: / PAGE_ID /喂页面访问令牌让你的网页的饲料。页面access_token可以使用API​​来获得:<?code> ME /帐户域= access_token,名称(<一href="https://developers.facebook.com/tools/explorer?method=GET&path=me%2Faccounts%3Ffields%3Daccess_token%2Cname">Demo)用户授权/登录后。

Based on your requirement, you just need to use the API: /PAGE_ID/feed with the page access token to get the feeds of your page. The page access_token can be obtained with the API: me/accounts?fields=access_token,name (Demo) after the user authorization/login.

您可以在这里测试这个API:<一href="https://developers.facebook.com/tools/explorer?method=GET&path=PAGE_ID%2Ffeed">Graph API浏览器 ,使用默认的令牌已经present那里。

You can test this API here: Graph API Explorer, using the default token already present there.

更聪明的方法

(不使用Facebook的API)

(Without using the facebook API)

由于您的要求仅涉及后端流程,您可以使用此方法。

Since your requirement involves only back-end processes, you can use this method.

  1. 首先,获得长寿的页面访问令牌(永不过期)。详细步骤<一href="http://stackoverflow.com/questions/18261813/what-are-the-steps-to-getting-a-long-lasting-token-for-posting-to-a-facebook-fan/18322405#18322405">here.你可以使用从这里 短命令牌。

  1. First of all, get the Long-lived page access token (that never expires). Detailed steps here. You can use the short-lived token from here.

使用该令牌,并作出 \ GET 要求:

Use this token and make a \GET request to :

<一个href="https://graph.facebook.com/PAGE_ID/feed?access_token=TOKEN_FROM_STEP_1">https://graph.facebook.com/PAGE_ID/feed?access_token=TOKEN_FROM_STEP_1

(您可以检查结果在浏览器中)

(You can check the result in the browser)

这就是它!

这篇关于新闻提要从Facebook墙上一个Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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