我已经编写了一个用于在 facebook 上发送 apprequest 的代码示例。
这是我的代码:
Facebook facebook = new Facebook(APP_ID);
Bundle params = new Bundle();
params.putString("title", "Goal Machine");//name
params.putString("message", sendInvite);//link
params.putString("to", Constant.facebookIdBuffer.toString());
params.putString("data", Constant.shortAppUrlForAndroid+"\n"+Constant.shortAppUrlForIphone);
facebook.dialog(_activity, "apprequests", params, new DialogListener() {//send
@Override
public void onComplete(Bundle values) {
Constant.facebookIdBuffer=null;
postToWall(sendInvite);
}
@Override
public void onFacebookError(FacebookError error) {
Constant.showAlertDialog("Error", "Can't send ally request!", _activity.getParent(), false);
Constant.facebookIdBuffer=null;
}
@Override
public void onError(DialogError e) {
Constant.showAlertDialog("Error", "Can't send ally request!", _activity.getParent(), false);
Constant.facebookIdBuffer=null;
}
@Override
public void onCancel() {
Constant.showAlertDialog("Error", "Can't send ally request!", _activity.getParent(), false);
Constant.facebookIdBuffer=null;
}
});
但它不断显示错误对话框:
请建议我出了什么问题..?