1

I am working on Facebook Integration in my Android app. I am able to send attachment by using "stream.publish" with opening dialog. Is there a way to post without opening dialog? I am using following method.

Please give me any idea.

            postParams.put("seriesname", "Commented during the TV show"+" '"+series+"'");
            postParams.put("description", text);
            parameters.putString("attachment", "{\"name\":\""+postParams.get("seriesname")+"\","
                    +"\"href\":\""+"http://www.google.com\","+"\"description\":\""+postParams.get("description")+"\"}");

            mFacebook.dialog(FacebookComments.this, "stream.publish", parameters, new SampleDialogListener());
            Log.d("FACEBOOK RESPONSE", response);
            if (response == null || response.equals("")
                    || response.equals("false")) {
                Log.v("Error", "Blank response");
            }
        }
    } catch (Exception e) {
        Log.e("Facebook", "Error: " + e.getMessage());
    }
}
Mat
  • 202,337
  • 40
  • 393
  • 406

1 Answers1

3

Check this code for Posting in Facebook wall without Dialog :

public boolean postOnWall(String msg) {
    Log.d("Tests", "Testing graph API wall post");
     try {
         String response;
         Bundle parameters = new Bundle();
         parameters.putString("message", msg);
         parameters.putString("description", "test test test");
         parameters.putString("tags",person_id);
         response = ZValues.authenticatedFacebook.request("me/feed", parameters,"POST");
         Log.d("Tests", "got response: " + response);
         if (response == null || response.equals("") || response.equals("false")) {
            Log.v("Error", "Blank response");
            return false;
         }
     } catch(Exception e) {
         e.printStackTrace();
     }
    return true;
}

Check this for sending links in Post

Community
  • 1
  • 1
Venky
  • 11,049
  • 5
  • 49
  • 66
  • @Chandra Reddy If u found this answer is useful just add Reputation and if ur problem solved just accept my answer.. – Venky Sep 23 '11 at 11:49
  • Thanks for reply Venky. By using Facebook Graph API i am unable to post attachment. i want to post attachment(with Custom links) on Facebook wall without opening dialog. please let me know if you have any idea. – Chandra Reddy Sep 26 '11 at 04:33
  • 2
    is there any alternative method to post attachment without opening dialog using "stream.publish"? and also why Graph API not supporting post attachment? – Chandra Reddy Sep 27 '11 at 13:05