ストーリーを投稿できる Android アプリに取り組んでおり、ユーザーに写真をアップロードしてもらいたいです。
アプリには「publish_actions」権限があり、「user_generated」、「fb:explicitly_shared」があります。
私のコードは次のとおりです
ByteArrayOutputStream stream = new ByteArrayOutputStream();
if(bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream)) {
Log.i(TAG,"Bitmap compressed into stream successfully.");
}
postParams.putByteArray("image", stream.toByteArray());
postParams.putString("user_generated", "true");
postParams.putString(OBJECT,URL);
postParams.putString("fb:explicitly_shared", "true");
Log.i(TAG,"Executing facebook graph story request...");
Request request = new Request(session, "me/<appnamespace>:<action>", postParams, HttpMethod.POST, callback);
RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();
テストアカウントのタイムラインを確認するとストーリーは投稿されているのですが、画像がありません。問題は次の行にあると思います。
postParams.putByteArray("image", stream.toByteArray());
問題は、キーが「イメージ」ではないか、それがあなたのやり方ではないかのいずれかだと思います。
これを行う正しい方法は何ですか?