原问题
我做了一些更多的调查,看看文章底部的信息。谢谢!
我有一个Android应用程序,有脸书分享选项。我做了应用程序的分享部分,大部分来自Fb上的教程。Dev.网站,见: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中。见图:

当我运行调试器并在应用程序中调试时,所有的postParams都运行良好,Bundle拥有所有的文本,但是共享看起来是一样的(而不是所有的文本)。
Bundle抛出一些意想不到的ClassNotFoundExceptions,但我认为这是IDE中的一个错误,请参阅这个所以问题。

所有电话中丢失的短信都不一样。在一些电话中,图片也会丢失,但我确信,URL是正确的。
我知道,这在2-3周前起作用了,直到今天才有人碰过这个密码。
你能帮帮我吗,是什么导致了这个问题?
谢谢!
编辑
我尝试了Facebook的图API资源管理器,发送同样的查询,我得到了相同的结果(丢失文本,等等)。
以下是查询:

图形API有可能是错误的/坏的吗?在过去的几周里有变化吗?状态页说,API是健康的。
Edit#2
好的,所以如果我想要共享任何链接,thoose属性可以工作。但是如果我想分享到Google的链接,这些属性就会停止工作。
发布于 2014-11-17 14:33:04
这可能导致了我的问题,Google Play Store在代码中定义了oauth标记,所以FB解析标记而不是我的内容。
我发现,最好的解决方案是链接到一个空白站点,在那里我用JavaScript重定向我的用户。
发布于 2014-11-17 06:59:27
而不是这样使用Facebook拨号
private void publishFeedDialog() {
Bundle params = new Bundle();
params.putString("name", "Facebook SDK for Android");
params.putString("caption", "Build great social apps and get more installs.");
params.putString("description", "The Facebook SDK for Android makes it easier and faster to develop Facebook integrated Android apps.");
params.putString("link", "https://developers.facebook.com/android");
params.putString("picture", "https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png");
WebDialog feedDialog = (
new WebDialog.FeedDialogBuilder(getActivity(),
Session.getActiveSession(),
params))
.setOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(Bundle values,
FacebookException error) {
if (error == null) {
// When the story is posted, echo the success
// and the post Id.
final String postId = values.getString("post_id");
if (postId != null) {
Toast.makeText(getActivity(),
"Posted story, id: "+postId,
Toast.LENGTH_SHORT).show();
} else {
// User clicked the Cancel button
Toast.makeText(getActivity().getApplicationContext(),
"Publish cancelled",
Toast.LENGTH_SHORT).show();
}
} else if (error instanceof FacebookOperationCanceledException) {
// User clicked the "x" button
Toast.makeText(getActivity().getApplicationContext(),
"Publish cancelled",
Toast.LENGTH_SHORT).show();
} else {
// Generic, ex: network error
Toast.makeText(getActivity().getApplicationContext(),
"Error posting story",
Toast.LENGTH_SHORT).show();
}
}
})
.build();
feedDialog.show();
}https://stackoverflow.com/questions/26844654
复制相似问题