Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

news feed from facebook wall to a android app

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?

like image 692
user2730344 Avatar asked Sep 01 '13 14:09

user2730344


People also ask

How do I change Facebook news feed to most recent on Android?

Tap in the top right of Facebook. Scroll down and tap Most Recent. Learn the difference between top posts and most recent posts in Feed.

How do I get my Facebook app in chronological news feed?

After clicking on the Feed tab, users will be able to toggle over to a chronological presentation of their Facebook favorites, Facebook groups they have joined or feeds consisting exclusively of posts from all their Facebook friends in the order they were shared.


1 Answers

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.

  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.

  2. 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!

like image 174
Sahil Mittal Avatar answered Sep 28 '22 04:09

Sahil Mittal