gpt4 book ai didi

android - 在 Android 中放置 facebook 墙

转载 作者:太空宇宙 更新时间:2023-11-03 10:29:34 25 4
gpt4 key购买 nike

我正在尝试从我的应用程序中将帖子整合到一个人的墙上。我尝试了这段代码,但我得到了这样的回应

   public void postMessageOnWall(String msg) {
Log.d("Tests", "Testing graph API wall post");
try {
String response = mFacebook.request("feed");
Bundle parameters = new Bundle();
parameters.putString("message", "dfsagfsadfsafsadf by thamil");
parameters.putString("description", "test test test");

response = mFacebook.request("feed", parameters);
Log.d("Tests", "got response: " + response);
if (response == null || response.equals("") ||
response.equals("false")) {
Log.v("Error", "Blank response");
}
} catch(Exception e) {
e.printStackTrace();
}

}




' {"error":{"message":"No node specified","type":"Exception"}}'

最佳答案

您需要指定要发布到的供稿,例如

response = mFacebook.request("me/feed", parameters, "POST");

这将发布到您自己的供稿中。

Facebook 在 GitHub 上提供了一些有用的示例,例如 this one (向下滚动到 testAuthenticatedApi() 方法,查看您正在尝试执行的操作的示例)。

关于android - 在 Android 中放置 facebook 墙,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8093718/

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