I am developing an application which have an option to share an image via facebook. I use the following code for posting and i am using sdk 3.0. I cant change the sdk version due to some reasons. Please help me.
public void postImage()
{
Bitmap img = BitmapFactory.decodeResource(getResources(),
R.drawable.ic_launcher);
Request uploadRequest = Request.newUploadPhotoRequest(
Session.getActiveSession(), img, new Request.Callback() {
@Override
public void onCompleted(Response response) {
Toast.makeText(PhotoGallery.this,
"Photo uploaded successfully",
Toast.LENGTH_LONG).show();
}
});
}
Also i use
<provider
android:name="com.facebook.NativeAppCallContentProvider"
android:authorities="com.facebook.app.NativeAppCallContentProvider1613067868978775"
android:exported="true" />
in manifest
Edit
OK, finaly i got the problem, in ported android applications, facebook sdk does not support photo sharing. But, we can share simple messages on the wall using fb sdk.