首先,对不起我糟糕的英语。我尝试在 android 上与 facebook 和我的游戏集成。但我遇到了一个问题。我已经向我的朋友发送了邀请请求。并且响应还可以。但它似乎并没有真正起作用。目标朋友看不到邀请请求。应用程序是否为沙盒模式都是一样的。
我的代码如下:
private static void doRequestInvite() {
Bundle params = new Bundle();
params.putString("message", "Let's play together");
WebDialog requestsDialog = (
new WebDialog.RequestsDialogBuilder( activity, Session.getActiveSession(), params))
.setOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(Bundle values, FacebookException error) {
if( toastFeedback) {
if (error != null) {
if (error instanceof FacebookOperationCanceledException) {
Toast.makeText( activity.getApplicationContext(), "Request cancelled", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText( activity.getApplicationContext(), "Network Error", Toast.LENGTH_SHORT).show();
}
} else {
final String requestId = values.getString("request");
if (requestId != null) {
Toast.makeText( activity.getApplicationContext(), "OK to invite", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText( activity.getApplicationContext(), "Request cancelled", Toast.LENGTH_SHORT).show();
}
}
}
}
})
.build();
requestsDialog.show();
}
public static void requestInvite() {
...
// this is not main UI thread. but web dialog must be run on main UI thread
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
doRequestInvite();
}
});
}
我能做些什么来检查这个?请给一些提示。