Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7999323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:28:24+00:00 2026-06-04T15:28:24+00:00

I have been able to pull the Facebook newsfeed for the logged in user

  • 0

I have been able to pull the Facebook newsfeed for the logged in user using the “me/home” Graph API Call and am displaying the result in an activity.

Now I have been trying numerous methods which will query the post’s like column and check if the current user has liked a post to display the status. Essentially, I am setting a drawable to indicate the user has liked a post.

I cannot really post any code that I have tried so far simply because none of them work. And believe me, I have tried literally numerous methods.

I would appreciate if someone could at least prod me in the right direction.

EDIT: This is my latest attempt at querying the likes column and comparing the result with the current user’s ID:

This code is where I am checking for likes count and adding them to an ArrayList. This is also where I am running the query to get the likes on the post.

// GET THE POST'S LIKES COUNT

    if (json_data.has("likes")) {
        JSONObject feedLikes = json_data.optJSONObject("likes");
        String countLikes = feedLikes.getString("count");
        postLikesCountArrayList.add(countLikes);

        // TEST STARTS

        // QUERY THE LIKES COLUMN TO CHECK YOUR LIKE STATUS ON A POST

        Bundle params = new Bundle();
        params.putString(Facebook.TOKEN, Utility.mFacebook.getAccessToken());
        Utility.mAsyncRunner.request(finalThreadID + "/likes&limit=200", params, new LikesListener());

        // TEST ENDS
        } else {
            String countLikes = "0";
            postLikesCountArrayList.add(countLikes);
        }

And this code block is the Listener (a privte class in the same activity) where the results are checked:

private class LikesListener extends BaseRequestListener {
        @Override
        public void onComplete(final String response, final Object state) {

            try {
                JSONObject JOLikes = new JSONObject(response);

                JSONArray JALikes = JOLikes.getJSONArray("data");

                for (int i = 0; i < JALikes.length(); i++) {
                    JSONObject JOTemp = JALikes.getJSONObject(i);

                    if (JOTemp.has("id"))   {
                        String getTempID = JOTemp.getString("id");

                        if (getTempID.equals(initialUserID))    {

                            Runnable run = new Runnable() {

                                @Override
                                public void run() {
                                    // TODO Auto-generated method stub


                                    ImageView postYourLike = (ImageView) findViewById(R.id.postYourLike);
                                    postYourLike.setBackgroundResource(R.drawable.btn_icon_liked);
                                }
                            };
                            TestNewsFeeds.this.runOnUiThread(run);
                        }
                    }

                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:28:26+00:00Added an answer on June 4, 2026 at 3:28 pm

    You can use this fql. Replace the post_id

    SELECT likes.can_like, likes.user_likes FROM stream WHERE  post_id = "1274834235_3976149403543"
    

    response would look like this, if user_likes is true, he has liked it

     {
      "data": [
        {
          "likes": {
            "can_like": true, 
            "user_likes": false
          }
        }
      ]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on trying to pull friends birthdays from the facebook API
Hi I have been able to extract a VARCHAR to a date using string_to_date
Until today, I have been able to use bzr pull server:path/to/trunk , but today
I have been looking for information on how to authenticate to the facebook api
I have been able to run my C# .net 3.5 app just fine on
I have been able to make my photos large for single photo posts on
I have been able to find lots of examples of adding a Dropdown list
I have been able to design my layout so that it has 2 columns
I have been able to set up OBDC in Filemaker, and added table ,
I have been trying different things and still have been able to get exactly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.