gpt4 book ai didi

android - Facebook 分享 - 缺少文本

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:16:02 30 4
gpt4 key购买 nike

原始问题

我做了更多研究,请参阅帖子底部的信息。谢谢!

我有一个 Android 应用程序,带有 Facebook 共享选项。我主要从 Fb 上的教程中完成了应用程序的共享部分。开发。网站,请参阅:https://developers.facebook.com/docs/android/share

这是实际的代码:

Request.newMeRequest(session, new Request.GraphUserCallback() {
@Override
public void onCompleted(GraphUser user, Response response) {
Bundle postParams = new Bundle();
String name = String.format(getResources().getString(R.string.shareFacebook_title), user.getName(), petName);
String caption = String.format(getResources().getString(R.string.shareFacebook_caption));
String description = String.format(getResources().getString(R.string.shareFacebook_description), user.getName(), petName, shelterName);
postParams.putString("name", name);
postParams.putString("caption", caption);
postParams.putString("description", description);
postParams.putString("link", getResources().getString(R.string.shareFacebook_url));
postParams.putString("picture", petPicUrl);

Request request = new Request(session, "me/feed", postParams,
HttpMethod.POST);

RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();
}
}).executeAsync();

我的问题是,共享链接没有我放入bundle 中的所有文本。看图:

Facebook share

当我运行调试器并调试到应用程序时,所有 postParams 运行正常,Bundle 包含所有文本,但共享看起来一样(并且没有所有的文本)。
Bundle 抛出一些意外的 ClassNotFoundExceptions,但我认为这是 IDE 中的一个错误,参见 SO question .

Debugging in the IDE

所有手机中丢失的文本都不相同。在某些手机上,图片也是小姐,但我确定 URL 是正确的。

我知道,这在 2-3 周前有效,直到今天才有人碰过这段代码。

你能帮我看看是什么问题造成的吗?
谢谢!

编辑

我试过 Facebook 的 Graph API Explorer , 发送相同的查询,我得到了相同的结果(缺少文本等)。

这是查询:

The same query from the Graph API Explorer

Graph API 是否有可能错误/损坏?过去几周有变化吗? status page说,API 是健康的。

编辑#2

好的,所以如果我想分享任何链接,选择属性就可以了。但是,如果我想分享指向 Google Play 的链接,属性将停止工作。

最佳答案

可能这导致了我的问题,Google Play 商店在代码中定义了 oauth 标签,因此 FB 解析该标签而不是我的内容。

我发现最好的解决方案是链接到一个空白站点,然后我使用 JavaScript 重定向我的用户。

关于android - Facebook 分享 - 缺少文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26844654/

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