【发布时间】:2015-04-30 03:57:14
【问题描述】:
我正在使用 facebook SDK 发出图形请求:
GraphRequest.newMeRequest(AccessToken, this);
在我的onCompleted(JSONObject user, GraphResponse graphResponse) 回调中,我想处理任何错误。目前,我将其设置为:
if (graphResponse.getError() != null) {
// I intend to raise make a toast and display any errors here to the user.
Log.d(TAG, graphResponse.getError().toString());
}
有没有一种简单的方法来创建错误的 AccessToken 以便我可以捕获错误?文档here 为它指定了一个构造函数,但这很乏味。
我正在运行适用于 Android 的 Facebook SDK 4.0.1。
谢谢!
【问题讨论】:
标签: android facebook facebook-graph-api