Upload Photo to Facebook with Facebook Android Sdk in Android

How can I upload an image in facebook using facebook SDK in android

See the Feed dialog documentation here:

https://developers.facebook.com/docs/reference/dialogs/feed/

The "source" parameter only accepts URLs. If you want to upload an image, you should get the publish_actions permissions from the user, and use Request.newUploadPhotoRequest method.

Uploading to a album of a page on Facebook using Android sdk

  • You need manage_pages and publish_pages
  • You need to use a Page Token of that Page
  • Use the /album/photos endpoint to post a photo: https://developers.facebook.com/docs/graph-api/reference/v3.3/album/photos#publish

Additional information about the Graph API in general and login: https://developers.facebook.com/docs/graph-api/using-graph-api

Share text and Image together using Facebook SDK in Android

Hey this code might be helpful,

Bundle parameters = new Bundle();
parameters.putString("message", category_item_name_desc.getText().toString());
parameters.putString("picture", categoryItemsModel.getImageUrl());
parameters.putString("caption", txtDescription_desc.getText().toString());
facebook.request("/me/feed", parameters, "POST");

You can add text by adding paramater as "caption"

Share Image and Text to Facebook on android

Was able to do this my self with the current Facebook SDK (3.14.1 at the time) with no login and I made it into a share intent for adding to the chooser list.

I have a demo project at https://github.com/b099l3/FacebookImageShareIntent only dependency is the facebook sdk and it is contained in one activity.



Related Topics



Leave a reply



Submit