Android : How to upload Photo on facebook wall using facebook sdk in android?

on Friday, September 5, 2014


I am using facebook SDK 3.17.2 for upload photo on facebook wall. I have used number of code to handle this but m not success. Now i have got a new code which is uploading photo on facebook wall perfectly, but it is working only when i my own facebook user id to login. in short it is working only with my Facebook id. When i use any other facebook user id to upload photo its not working :( please help me regarding this issue. this is my code :



Session.openActiveSession(ArchiveLandscape_Screen.this, true, new Session.StatusCallback() {

@Override
public void call(Session session, SessionState state, Exception exception) {
// TODO Auto-generated method stub
// Bitmap bi = BitmapFactory.decodeResource(getResources(), R.drawable.galaxy_bg);
Bitmap bi = ArchiveDownLoadImages_Screen.portraitBitmapArchive;
Request request = Request.newUploadPhotoRequest(Session.getActiveSession(), bi, new Request.Callback() {
@Override
public void onCompleted(Response response) {
// showPublishResult("photo_post", response.getGraphObject(), response.getError());
//Toast.makeText(getApplicationContext(), "Success", 6000).show();
}
});
Bundle parameters = request.getParameters();
parameters.putString("message","Get a new post delivered everyday\n"+Strcontent.replaceAll("<br/>", "\n"));
parameters.putString("link","URL");
request.setParameters(parameters);
request.executeAsync();

}
});

0 comments:

Post a Comment