无法生成preVIEW用户 [英] failed to generate preview for user
问题描述
我想从一个Android模拟器Facebook的文档实现这一点。
I'm trying to implement this from the facebook docs on an Android Emulator.
https://developers.facebook.com/docs/android/share-dialog /
OpenGraphAction action = GraphObject.Factory.create(OpenGraphAction.class);
action.setProperty("book", "https://example.com/book/Snow-Crash.html");
FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(this, action, "books.reads", "book")
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
这一直给错误消息
It keeps giving the error message
错误:com.facebook.FacebookException:无法生成preVIEW用户
Error: com.facebook.FacebookException: Failed to generate preview for user.
我使用的是FbAndroid-3.9.apk
I'm using the FbAndroid-3.9.apk
我有一个命名空间,但没有appened书。
I've appened the book with a namespace but nothing.
推荐答案
这是如何使用Facebook的对话框中设置了一个开放的图形操作。
This is how you can set up an open graph action using facebook dialog.
OpenGraphObject setObj = OpenGraphObject.Factory.createForPost("your app namespace:object type");
setObj.setProperty("title", "Title required");
/ *对于歌曲的内容类型music.song。您可以在此链接搜索找到你的对象的内容类型 https://developers.facebook.com/docs/opengraph/music * /
/* For songs content type is music.song. You can search in this link to find content type of your object https://developers.facebook.com/docs/opengraph/music */
setObj.getData().setProperty("type", "content type of your object");
setObj.setProperty("url", "your url");
setObj.setProperty("description", "your description");
OpenGraphAction action = GraphObject.Factory.create(OpenGraphAction.class);
/ *你的行动是行动,你设置为开放式图形为您的应用程序* /
/* Your action is the action you setup as open graph for your app */
action.setType("your app name space:your action");
/ *你的对象名称可以是一首歌或类似的东西* /
/* Your object name can be a song or something like that */
action.setProperty("your object name", setObj);
/ *最后* /
/* And finally */
FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(context, action, "your object name").build();
uiHelper.trackPendingDialogCall(shareDialog.present());
这篇关于无法生成preVIEW用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!