gpt4 book ai didi

android - 尝试发布到 friend 墙时出现 OAuthException

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:37:12 25 4
gpt4 key购买 nike

我在尝试使用 Android 中的 Facebook API 发布到 friend 墙时遇到了很多麻烦。这是我目前拥有的:

if (facebook.isSessionValid()) {
String response = facebook.request((userID == null) ? "me" : userID);

Bundle params = new Bundle();
params.putString("message", "put message here");
params.putString("link", "http://mylink.com");
params.putString("caption", "{*actor*} just posted this!");
params.putString("description", "description of my link. Click the link to find out more.");
params.putString("name", "Name of this link!");
params.putString("picture", "http://mysite.com/picture.jpg");

response = facebook.request(((userID == null) ? "me" : userID) + "/feed", params, "POST");

Log.d("Tests",response);
if (response == null || response.equals("") ||
response.equals("false")) {
Log.v("Error", "Blank response");
}
} else {
// no logged in, so relogin
Log.d("1234567890", "sessionNOTValid, relogin");

}
}catch(Exception e){
e.printStackTrace();
}

但是返回这个错误:

12-11 21:34:06.604: D/FACEBOOK RESPONSE(14954): {"error":{"message":"(#200) Feed story publishing to other users is disabled for this application","type":"OAuthException","code":200}}

最佳答案

您可能最近创建了这个 Facebook 应用程序,这意味着 2013 年 2 月的重大更改已启用。

February's Breaking Changes包括:

Removing ability to post to friends walls via Graph API

We will remove the ability to post to a user's friends' walls via the Graph API. Specifically, posts against [user_id]/feed where [user_id] is different from the session user, or stream.publish calls where the target_id user is different from the session user, will fail. If you want to allow people to post to their friends' timelines, invoke the feed dialog. Stories that include friends via user mentions tagging or action tagging will show up on the friend’s timeline (assuming the friend approves the tag). For more info, see this blog post.

我们将从 2 月开始禁用此功能,如果您希望启用它(仅在 2 月之前暂时启用),请转到您的应用仪表板 > 设置 > 高级 > 禁用“2013 年 2 月重大更改”

我强烈建议不要这样做,但是,从 2 月开始,此功能将导致您的应用再次抛出相同的错误。

关于android - 尝试发布到 friend 墙时出现 OAuthException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13829086/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com