目前我正在为我使用 Facebook SDK 开发一个 Android 应用程序。将消息发布到墙上等效果很好,但是通过这个 SDK 我无法向其他人发送应用程序请求。
谁能帮我吗?
这是我的代码片段:
Bundle params = new Bundle();
params.putString("message", getString(R.string.request_message));
Utility.mFacebook.dialog(Hackbook.this, "apprequests", params, new AppRequestsListener());
和AppRequestsListener:
public class AppRequestsListener extends BaseDialogListener {
@Override
public void onComplete(Bundle values) {
Toast toast = Toast.makeText(getApplicationContext(), "App request sent", Toast.LENGTH_SHORT);
toast.show();
}
@Override
public void onFacebookError(FacebookError error) {
Toast.makeText(getApplicationContext(), "Facebook Error: " + error.getMessage(), Toast.LENGTH_SHORT).show();
}
@Override
public void onCancel() {
Toast toast = Toast.makeText(getApplicationContext(), "App request cancelled", Toast.LENGTH_SHORT);
toast.show();
}
}