这是我在这里的第一篇文章,所以请放轻松:)
我正在将 Facebook SDK 集成到 Android 应用程序中。用户登录后,我想向他展示应用程序在 facebook 中的最后一篇文章,所以我很想用(作为图形对象)来获取它:
Bundle params = new Bundle();
params.putInt("limit", 1);
Request request = new Request(session, inRequestId + "/posts/?limit=1&access_token=" +
session.getAccessToken().toString(), params, HttpMethod.GET, new Request.Callback() {
@Override
public void onCompleted(Response response) {
if(response != null){
if(response.getError() != null)
Toast.makeText(getActivity(), "Error retrieveng last post", Toast.LENGTH_SHORT).show();
else {
updateFacebookView( response.getGraphObject().getInnerJSONObject() );
}
}
}
});
request.executeAsync();
这行得通,我认为很好,但是如果我想在没有graphPath的limit = 1参数(inRequestId +“/posts/?access_token =”+ session.getAccessToken().toString())的情况下实现它,它没有限制,如果我不把捆绑参数“限制”,(作为字符串或作为 int 测试),它会给我这个错误:
09-30 17:51:47.094: E/caca(19703): {HttpStatus: 400, errorCode: 190, errorType:
OAuthException, errorMessage: Malformed access token
CAAT76i2gxTgBAKyLzc8SI6y7V1pGJ0fmbLWCtuKdhHIEZAQBA0jYx4YqZB8IgRDJMUlw1XrvZCLJ8kxKdZCRG3LNbrVL8fB34ZBlyvlqadT192MCWMkst1lMSdFwtRVPWiSNfBfi8Gq2RHZCWskrBVTjAwPDKyDMGLSU8sPnXfe0r2tsZBdZCXLCOJGQtE76sJkr7n8SdOU4j1KopkvT0Mux7QBGf7ZBXtCRqDnsZAZCxSNHAZDZD?access_token=CAAT76i2gxTgBAKyLzc8SI6y7V1pGJ0fmbLWCtuKdhHIEZAQBA0jYx4YqZB8IgRDJMUlw1XrvZCLJ8kxKdZCRG3LNbrVL8fB34ZBlyvlqadT192MCWMkst1lMSdFwtRVPWiSNfBfi8Gq2RHZCWskrBVTjAwPDKyDMGLSU8sPnXfe0r2tsZBdZCXLCOJGQtE76sJkr7n8SdOU4j1KopkvT0Mux7QBGf7ZBXtCRqDnsZAZCxSNHAZDZD}
我没有正确使用它还是一个错误?提前致谢