【发布时间】:2014-04-01 19:05:43
【问题描述】:
我想向我选择的 Facebook 朋友发送通知,根据文档,我使用了以下代码。
private void sendNotification() {
Bundle params = new Bundle();
params.putString("href", "/testurl?param1=value1");
params.putString("template", "This is a test message");
/* make the API call */
new Request(Session.getActiveSession(), "/me/notifications", params,
HttpMethod.POST, new Request.Callback() {
public void onCompleted(Response response) {
/* handle the result */
Log.d(LOG_TAG, response.toString());
}
}).executeAsync();
}
我尝试了很多,发现 Facebook 已经阻止了在朋友墙上发帖的权限,所以我可以选择发送通知来通知自己与选定朋友的活动。 此代码不适用于我。如果有人有解决方案,请分享。我将非常感激。谢谢
【问题讨论】:
-
错误:{HttpStatus: 403, errorCode: 200, errorType: OAuthException, errorMessage: (#200) 只有网络画布应用可以发送应用通知}}
标签: android facebook facebook-graph-api notifications facebook-android-sdk