Blackberry Facebook SDK,发布状态更新时遇到 403 Forbidden

发布于 2025-01-02 19:45:19 字数 1304 浏览 2 评论 0原文

我想将 Facebook 与我的 Blackberry 应用程序集成。为此,我下载了适用于 Blackberry 的 Facebook SDK。我使用以下代码将状态发布到用户的 FB:

String NEXT_URL = "http://www.facebook.com/connect/login_success.html";
String APPLICATION_ID = "xxxxxxxxxxxx";
String APPLICATION_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
String[] PERMISSIONS = Facebook.Permissions.USER_DATA_PERMISSIONS;              

ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
Facebook fb = Facebook.getInstance(as);

try{
 User user = fb.getCurrentUser();
 String result = user.publishStatus("Hello world!");
 if ((result != null) && !result.trim().equals("")) {
    Dialog.inform("Publish Success.");
 } else {
    Dialog.inform("Publish Failed.");
 }

}catch(FacebookException fe){
  fe.printStackTrace();
}

登录成功,它正确返回到我的应用程序,并以 json 格式获取用户详细信息。但是当 publishStatus() 被触发时,进程失败。以下是有关 publishStatus() 操作的调试窗口详细信息。

2012-02-07 10:46:51 [INFO] HTTP-POST (TCP WIFI):  https://graph.facebook.com/xxxxxxxxxxx/feed;interface=wifi
2012-02-07 10:46:51 [INFO] HTTP-POST Response:  403 Forbidden
2012-02-07 10:46:51 [INFO] HTTP-POST Body:  text/javascript; charset=UTF-8(0)

403禁止错误的原因是什么?访问令牌是否应该与上面的 URL 一起使用?如果是的话,如何整合呢?

I want to integrate Facebook with my Blackberry app. For that I have downloaded the Facebook SDK for Blackberry. I am using the following code for posting status to the User' FB:

String NEXT_URL = "http://www.facebook.com/connect/login_success.html";
String APPLICATION_ID = "xxxxxxxxxxxx";
String APPLICATION_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
String[] PERMISSIONS = Facebook.Permissions.USER_DATA_PERMISSIONS;              

ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
Facebook fb = Facebook.getInstance(as);

try{
 User user = fb.getCurrentUser();
 String result = user.publishStatus("Hello world!");
 if ((result != null) && !result.trim().equals("")) {
    Dialog.inform("Publish Success.");
 } else {
    Dialog.inform("Publish Failed.");
 }

}catch(FacebookException fe){
  fe.printStackTrace();
}

The log in is successful, it is returning to my application properly and getting the user details in json format also. But when publishStatus() is fired, process is failed. Here is debug window details on publishStatus() operation.

2012-02-07 10:46:51 [INFO] HTTP-POST (TCP WIFI):  https://graph.facebook.com/xxxxxxxxxxx/feed;interface=wifi
2012-02-07 10:46:51 [INFO] HTTP-POST Response:  403 Forbidden
2012-02-07 10:46:51 [INFO] HTTP-POST Body:  text/javascript; charset=UTF-8(0)

What is reason for the 403 forbidden error? Is the access token should be with this above URL? If it is, how to integrate it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁对谁错谁最难过 2025-01-09 19:45:19

必须更改权限,问题就解决了。

String[] PERMISSIONS = Facebook.Permissions.ALL_PERMISSIONS;   

Have to change the permission and problem is solved.

String[] PERMISSIONS = Facebook.Permissions.ALL_PERMISSIONS;   
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文