Blackberry Facebook SDK,发布状态更新时遇到 403 Forbidden
我想将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
必须更改权限,问题就解决了。
Have to change the permission and problem is solved.