新闻Feed从Facebook墙壁到一个Android应用程序 [英] news feed from facebook wall to a android app
问题描述
更好地解释 -
我在Facebook上有一个关于一个足球俱乐部的页面,在那里我发布了关于新闻,游戏等的几个信息。现在我已经做了一个Android应用程序,我的问题是,我可以导入到Android应用程序的帖子?
当然可以。首先,如果您是Facebook的新功能集成 - 阅读Android集成的基础知识,登录/授权调用其API等(根本不复杂)。
Facebook提供了许多使用 访问令牌 。
根据您的要求,您只需使用API: / PAGE_ID / feed
与页面访问令牌
获取您的页面的Feed。可以使用API获取页面access_token: me / accounts?fields = access_token,name
( Demo )在用户授权/登录后。
您可以在此测试此API: 图形API资源管理器 ,使用已存在的默认令牌。
更聪明的方式
(不使用Facebook API)
由于您的要求仅涉及后端进程,因此可以使用此方法。
-
使用此令牌并作出
\GET
请求:
https://graph.facebook.com/PAGE_ID/feed? access_token = TOKEN_FROM_STEP_1
(您可以在浏览器中查看结果)
这是它!
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.
To explain better-
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?
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 provides many APIs (for different functions) that uses the access token.
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.
You can test this API here: Graph API Explorer, using the default token already present there.
Smarter way
(Without using the facebook API)
Since your requirement involves only back-end processes, you can use this method.
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.
Use this token and make a
\GET
request to :https://graph.facebook.com/PAGE_ID/feed?access_token=TOKEN_FROM_STEP_1
(You can check the result in the browser)
This is it!
这篇关于新闻Feed从Facebook墙壁到一个Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!