vendredi 10 avril 2015

How to post picture along with text/caption on Facebook

I am developing a application in which I want to share the picture on the facebook wall including my app link on playstore. I am using the Sharing intent to open the shooser dialog to make user open the facebook in that dialog and then share picture this Is How I am doing this:



Intent sharingIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);

sharingIntent.setType("image/*");
//ScreeshotUri contains picture path stored in device
sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
sharingIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
sharingIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(Intent.createChooser(sharingIntent, "Share Image"));


But through this way it is just taking me to wall to post the new Post and there is no picture to upload also. While if user select viber or gmail the picture is successfully uploaded. But not in Facebook.


Diging through some links I have Found that



Now facebook is not permitting to share the picture and text directly. We have to use the sdk provided by facebook.



So in this way I have to use facebook sdk. I have seen many tutorials But I do not understand any link more informative. I have a share button(btn_share) which is used to open the chooser dialog in my activity . Now suggest me what should I do :



  • If I use Sdk , do I have to make entire new class for handling face book And How can I integrate and share my image using facebook sdk. How can I pass the picture path to that?AS I have seen a tutorial, in which they are making custom button and all that stuff and making user to login and to post a new Post on facebook But I want a predefined Post(Including my app link and image) on his wall automatically

  • Should I made a new button to open the facebook activity of sdk or intent chooser dialog will do the job. I mean when User will click on facebook icon in chooser dialog will it launch the activity which is made to post a Image on wall ?


please share me a link which describe how to use facebook sdk in our project and how to share the picture on facebook wall.


Aucun commentaire:

Enregistrer un commentaire