Bundle params = new Bundle();
params.putString("to", useriId);
params.putString("message","Hello World");
WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(
JoinVia.this, Session.getActiveSession(), params))
.setOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(Bundle values,
FacebookException error) {
if (error != null) {
if (error instanceof FacebookOperationCanceledException) {
Toast.makeText(
JoinVia.this.getApplicationContext(),
"Request cancelled", Toast.LENGTH_SHORT)
.show();
} else {
Toast.makeText(
JoinVia.this.getApplicationContext(),
"Network Error", Toast.LENGTH_SHORT)
.show();
}
} else {
final String requestId = values
.getString("request");
if (requestId != null) {
Toast.makeText(
JoinVia.this.getApplicationContext(),
"Request sent", Toast.LENGTH_SHORT)
.show();
} else {
Toast.makeText(
JoinVia.this.getApplicationContext(),
"Request cancelled", Toast.LENGTH_SHORT)
.show();
}
}
}
}).build();
requestsDialog.show();
これは、友達IDに招待状を送信するための私のコードです。コードは通知を送信できますが、ブラウザーから通知アイコンをクリックすると、招待状が表示されません。友達のFacebookにメッセージを送る方法を教えてもらえますか?