メッセージとURLリンクとともにビットマップをFacebookのウォールに投稿する必要があります。
https://developers.facebook.com/docs/reference/api/user/#photosによると、Facebookアルバムに写真を追加するための4つのパラメーターがあります。
source
、、、、。message
_ place
_no_story
ただし、次のようなコードを使用することをお勧めします。
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")が表示されないことを除いて、正常に機能します。
私は3つの質問があります:
なぜ機能
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
、なぜ機能しないのですか?