메시지 및 URL 링크와 함께 Facebook에 Bitmap을 게시해야합니다.facebook API add photo
source
, message
, place
, no_story
: https://developers.facebook.com/docs/reference/api/user/#photos에 따르면
, 페이스 북 앨범에 사진을 추가 할 4 개 매개 변수가 있습니다.
그러나, 나는이 같은 코드를 사용하는 것이 좋습니다했다 :
Bitmap bm = ...;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(CompressFormat.JPEG, 100, baos);
final byte[] data = baos.toByteArray();
Bundle postParams = new Bundle();
postParams.putByteArray("photo", data);
postParams.putString("message", "My message here");
postParams.putString("link", "http://www.google.com");
Request request = new Request(session, "me/photos", postParams, HttpMethod.POST, callback);
RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();
를 ...하고 링크를 표시하지 않습니다 제외하고이 코드는 잘 작동 ("http://www.google.com") 벽에.
나는 세 가지 질문이 있습니다
왜
postParams.putByteArray("photo", data)
작동합니까? 설명서에 따라photo
매개 변수가 없습니다 (위 참조). 이link
매개 변수를 사용하는 것이 불가능하면, SLComposeViewController 클래스 (http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Reference/SLComposeViewController_Class/Reference/Reference.html) 어떻게 작동합니까? 그것은
- (BOOL)addURL:(NSURL *)url
방법이 있습니다.link
매개 변수를 사용할 수 있다면 왜 작동하지 않습니까?