0

in my android app I'm using facebook http api, and I need an ability for user to post message with photo to theirs wall. I've looked through open graph api, but I can't understand what action should I use. And one more, it seems that each story should be moderated by facebook first, and facebook asks me for steps to reproduce how stories would be published, but how can I do that if my app hasn't been released yet? Do I have to use facebook android sdk for my purposes?

Vadym Kovalenko
  • 699
  • 1
  • 11
  • 27

3 Answers3

0

First and foremost, integrate Facebook Android SDK 3.0 in your application. It is going to make your life a lot easier.

Code to attach data to your post :

        Bundle postParams = new Bundle();
        postParams.putString("name", "Facebook SDK for Android");
        postParams.putString("caption", "Build great social apps and get more installs.");
        postParams.putString("description", "The Facebook SDK for Android makes it easier and faster to develop Facebook integrated Android apps.");
        postParams.putString("link", "https://developers.facebook.com/android");
        postParams.putString("picture", "https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png");

Code to post on wall : me/feed

 Request request = new Request(session, "me/feed", postParams, 
                              HttpMethod.POST, callback);

The Facebook SDK Documentation is something you might want to go through.

gdros
  • 393
  • 2
  • 10
Swayam
  • 16,294
  • 14
  • 64
  • 102
  • Without using facebook default dialog is it possible for posting on user wall ,this code is clearly explaining post url,image on FB wall ,could you provide any example illustrating this ,It is very helpful for beginners(Like me) –  Jan 25 '14 at 18:40
  • @user2843350 : Sure, it indeed IS possible. Have a look at the answer given here :http://stackoverflow.com/questions/7528258/posting-attachment-without-open-dialog-using-facebook-android-sdk/7528388#7528388 – Swayam Jan 27 '14 at 04:08
0

You should use Facebook API for Android, it includes great number of examples that will work out for you. Specifically for how to post on user's wall, take a look at this link https://developers.facebook.com/docs/android/publish-to-feed/

Onur A.
  • 3,007
  • 3
  • 22
  • 37
0

I resolved my issue by using Graph Api (not open graph)

Vadym Kovalenko
  • 699
  • 1
  • 11
  • 27