怎么了?
我在Android上有一个facebook应用程序,我正在尝试向朋友发送邀请,认为这很简单。
我在Facebook上使用了示例代码,最终得到了类似的内容:
//从Facebook生成用户邀请以加入应用
public void generateFacebookInvitation(最终片段片段){
// start invite action
Bundle params = new Bundle();
String action = "apprequests";
// TODO: this doesn't populate the request correctly even though it's the way it's documented in facebook
// couldn't find the solution for this
params.putString("title", "Our App Request");
// params.putString("message", "Hello! Welcome to our app!");
// params.putString("new_style_message", "true");
dialog = new WebDialog.RequestsDialogBuilder (fragment.getActivity(), Session.getActiveSession(), /*action,*/ params).
setOnCompleteListener(new WebDialog.OnCompleteListener() {
@Override
public void onComplete(Bundle values, FacebookException error) {
dialog = null;
dialogAction = null;
dialogParams = null;
}
}).setMessage("Hello! Welcome to our app!").build();
Window dialog_window = dialog.getWindow();
dialog_window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
dialogAction = action;
dialogParams = params;
dialog.show();
}
然而,当对话框出现时 - 邀请消息的预览未显示,并且在邀请到达收件人时也没有显示。我见过几个类似的帖子,但是没有一个对我有帮助。您还可以从注释掉的代码中看到,我已经尝试了几种方法来实现邀请 - 但它们都采用相同的错误方式。所有的Facebook应用程序配置(如哈希)都是好的,我已经连续数小时与这些问题作斗争了!有人有什么好建议吗?
谢谢! -Lior