0
嘿我得到這個錯誤使用SDK雖然應用程序ID是正確的。Facebook錯誤:應用程序ID無效
現在,當我嘗試授權應用程序,它工作正常,並授權它,但是當我嘗試並提出請求時,Facebook返回此錯誤。我的應用已正確啓動並且不處於沙盒模式。
我找到了沒有有關此問題的信息,有人知道什麼會導致此問題嗎?
我嘗試使用下面的代碼上傳照片:
byte[] data = null;
Bitmap bi = BitmapFactory.decodeFile(photoToPost);
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);
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);
mAsyncRunner.request(null, params, "POST", new SampleUploadListener(), null);
SampleUploadListener:
public class SampleUploadListener extends BaseRequestListener {
public void onComplete(final String response, final Object state) {
try {
// process the response here: (executed in background thread)
Log.d("Facebook-Example", "Response: " + response.toString());
JSONObject json = Util.parseJson(response);
final String src = json.getString("src");
// then post the processed result back to the UI thread
// if we do not do this, an runtime exception will be generated
// e.g. "CalledFromWrongThreadException: Only the original
// thread that created a view hierarchy can touch its views."
} catch (JSONException e) {
Log.w("Facebook-Example", "JSON Error in response");
} catch (FacebookError e) {
Log.w("Facebook-Example", "Facebook Error: " + e.getMessage());
}
}
@Override
public void onFacebookError(FacebookError e, Object state) {
// TODO Auto-generated method stub
}
}
什麼錯誤訊息您在e.getMessage得到( )? – Igy
我會在幾個小時內編輯它,但基本上只是這個錯誤...它顯示了它試圖到達的頁面的URL –
那麼從API獲取的確切字符串是什麼?據我所知,不應該有'無效的應用程序ID'和一個URL,我不能想到一個錯誤消息,其中將包括 – Igy