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

  • SEARCH
  • Home
  • 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 7580249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:52:11+00:00 2026-05-30T17:52:11+00:00

In my project I authenticate my Facebook account in the first activity and retrieved

  • 0

In my project I authenticate my Facebook account in the first activity and retrieved the friends id,name, birthday and pic, who is having birthday on the current day. I bundled them to the next activity and displayed the pic and name in listview. I want to post some message to their wall, when I click on the list. I used the following code to post on friends wall while click on the listview.

  public static String APP_ID = "my_app_id";
        public static Facebook authenticatedFacebook = new Facebook(APP_ID);

In my listview onclickitemlistner I used the following code. id_list is an ArrayList contains the ids of the friends.

try{
                        Bundle parameters = new Bundle();
                        JSONObject attachment = new JSONObject();

                        try {
                            attachment.put("message", "Many more returns of the day");


                        } catch (JSONException e) {
                        }
                        parameters.putString("attachment", attachment.toString());

                        parameters.putString("target_id", id_list.get(position)); 
                        parameters.putString("method", "stream.publish");
                        String  response = authenticatedFacebook.request(parameters);       
                        Log.v("response", response);
                    }
                    catch(Exception e){}

In my response I got invalid API key. But I used the correct key.

11-10 16:21:53.987: V/response(396): {"error_code":101,"error_msg":"Invalid API key","request_args":[{"key":"method","value":"stream.publish"},{"key":"attachment","value":"{\"message\":\"Many more returns of the day\"}"},{"key":"format","value":"json"},{"key":"target_id","value":"100000635832872"}]}

I used the same code to post using the retrieved id of the friend in my first activity where I authenticate my account. It works fine. But not works in the second activity where I display them in listview. I checked whether the session is valid or not. It results in invalid.

  • 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-05-30T17:52:12+00:00Added an answer on May 30, 2026 at 5:52 pm

    I got it work. Just change the Facebook.java class. Changed DEFAULT_AUTH_ACTIVITY_CODE to FORCE_DIALOG_AUTH. And check for Facebook session. It works fine with my code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my current project, we need to authenticate users of an ASP.NET application against
I currently have a rails project that looks to let customers authenticate their account
For a current project I need to authenticate users against Active Directory in Java.
Project: http://design.vitalbmx.com/fave/news.html When I click Add to favorites button (under main pic), in Chrome
I am trying to use JAAS to authenticate my users. My project is in
In my first project going real DDD, I'm stuck with some doubts concerning which
I followed the step of Create a new Android Project with Facebook Login section
I'm trying to implement Facebook authentication into my web project. I've managed to get
I have a new Play 2 project with play-authenticate. I wrote some simple test
I'm working on a project that needs to authenticate users based on records in

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.