1

我正在构建一个允许 Facebook 用户创建新事件的应用程序。我注意到我无法在唯一的 Graph API 调用中创建事件并向其添加图像。所以我再次打电话发布图片:

 Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.my_image);
 Bundle params = new Bundle();
 params.putParcelable("source", bitmap); 
 Request postImageRequest = new Request(Session.getActiveSession(), eventId + "/picture", params, HttpMethod.POST, new Callback() {
           @Override
           public void onCompleted(Response response) {
                Log.e("", response.toString());
                finish();
           }
 });
 postImageRequest.executeAsync();

但是我从 FB 服务器收到了这个错误响应:

HttpStatus: 400, errorCode: 324, errorType: OAuthException, errorMessage: (#324) Missing or invalid image file}, isFromCache:false

4

1 回答 1

0
Request photoImageRequest= Request.newUploadPhotoRequest(Session.getActiveSession(), bitmap, new Request.Callback(){

@Override
public void onCompleted(Response response) {
Log.e("", response.toString());
finish();

}});
于 2013-10-08T05:55:54.973 回答