-1

当我尝试登录时,我能够正确验证。但是,当我尝试上传图片时,我收到一条错误消息:“应用程序 ID 无效”。我知道我正确复制/粘贴了应用程序 ID,所以我不确定问题出在哪里。

public void uploadFacebookPhoto(String path,String description)
{
    byte[] data = null;

    Bitmap bi = BitmapFactory.decodeFile(path);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    bi.compress(Bitmap.CompressFormat.JPEG, 100, baos);
    data = baos.toByteArray();

    Bundle params = new Bundle();
    params.putString("method", "photos.upload");
    params.putByteArray("picture", data);
    //params.putString("description", description);

    AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);
    mAsyncRunner.request(null, params, "POST", new SampleUploadListener(), null);
}

编辑:这是 logcat 的输出

响应:{"error_code":101,"error_msg":"无效的应用程序 ID。","re​​quest_args":[{"key":"method","value":"photos.upload"},{"key": "格式","值":"json"}]}

4

1 回答 1

0

原来我没有将以下内容添加到 onActivityResult()

mFacebook.authorizeCallback(requestCode, resultCode, data);
于 2012-05-18T07:41:10.227 回答