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