我引用了 Facebook SDK3.0 中的示例代码,使用 WebDialog 在我的墙上发布故事。
示例代码演示了用于构造 WebDialog.FeedDialogBuilder 的 Bundle 对象
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");
所以我改变了一些词来测试我的项目:
Bundle params = new Bundle();
params.putString("name", "Push test");
params.putString("caption", "hello");
params.putString("description", "hello");
params.putString("link", "");
params.putString("picture", "");
但是 WebDialog.FeedDialogBuilder 上的“名称”、“标题”、“描述”的结果消失了
然后我发现了params.putString("picture", "");
如果 URL 无效或字符串为空,则 WebDialog.FeedDialogBuilder 将不起作用。
带空字符串:
Bundle params = new Bundle();
params.putString("name", "Test");
params.putString("caption", "hello");
params.putString("description", "hello");
params.putString("link", "");
params.putString("picture", "");
使用无效的网址:
Bundle params = new Bundle();
params.putString("name", "Test");
params.putString("caption", "hello");
params.putString("description", "hello");
params.putString("link", "");
params.putString("picture", "null");
任何有效的网址:
Bundle params = new Bundle();
params.putString("name", "test");
params.putString("caption", "hello");
params.putString("description", "hello");
params.putString("link", "");
params.putString("picture", "http://www.technobuffalo.com/wp-content/uploads/2012/12/Google-Apps.jpeg");
仅使用三个参数:
Bundle params = new Bundle();
params.putString("name", "test");
params.putString("caption", "hello");
params.putString("description", "hello");
那么,我应该如何将正确的值传递给params.putString("picture", "");
可以让它在没有图片的情况下工作吗?