Posting text and picture using Facebook Android SDK
I am trying to post a picture and text to some user's news feed using the Facebook Android SDK (not using the Dialog), but for some reason it posts the picture and text only to the user's own timeline and not to the global news feed where his friends can see it. If I remove the picture param the text is shown in the news feed. Am I missing something?
This is my code:
//Prepare picture data
ByteArrayOutputStream baos = new ByteArrayOutputStream();
b.compress(Bitmap.CompressFormat.JPEG, 100, baos);
data = baos.toByteArray();
//Post data
Bundle params = new Bundle();
params.putString(Facebook.TOKEN, LoginActivity.mFacebook.getAccessToken());
params.putByteArray("picture", data);
params.putString("message", txt.getText().toString());
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(LoginActivity.mFacebook);
mAsyncRunner.request("me/feed ", params, "POST", new FacebookUploadListener(), null);
mAsyncRunner.request(response, new FacebookUploadListener());
Can I achieve that without the Facebook SDK's dialog?
链接地址: http://www.djcxy.com/p/49614.html