分享对话​​框返回异常,并与QUOT;未能生成用户的Facebook和QUOT preVIEW; [英] Share dialog returns exception with "failed to generate preview for user facebook"

查看:185
本文介绍了分享对话​​框返回异常,并与QUOT;未能生成用户的Facebook和QUOT preVIEW;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经转向使用新更新的Facebook SDK为Android。

在FacebookException类给出上述消息时,我尝试使用新的共享对话框。

任何之所以出现这种情况?

这里的code我使用。

  OpenGraphAction行动= GraphObject.Factory.create(OpenGraphAction.class);
            action.setProperty(对象,HTTP://object.url);FacebookDialog shareDialog =新FacebookDialog.OpenGraphActionDialogBu​​ilder(这一点,动作,appnamespace.action,对象)
                    。建立();
uiHelper.trackPendingDialogCall(shareDialog present());


解决方案

在时间和试错的时间,我终于想通了这一点。希望这是更简单不过。 Facebook的应提供code发生器。

不管怎么说,我的问题的解决方案是,行动一词必须匹配,Facebook的设置完美的人。看到这一点的唯一方法是在为各类开放式图形code发生器。

https://developers.facebook.com/apps/ {APP-ID} / opengraph /类型

您可以在动作类型部分上面的链接中找到它。

现在,采取的Facebook提供的命名空间和动作类型,并取代它。appnamespace:行动的

  OpenGraphAction行动= GraphObject.Factory.create(OpenGraphAction.class);
        action.setProperty(对象,HTTP://object.url);FacebookDialog shareDialog =新FacebookDialog.OpenGraphActionDialogBu​​ilder(这一点,动作,appnamespace.action,对象)
                。建立();
uiHelper.trackPendingDialogCall(shareDialog present());

I have switched to use the newly updated Facebook SDK for Android.

The above message was given in an FacebookException class when I tried to use the new Share Dialog.

Any reason why this happens?

Here's the code I'm using.

OpenGraphAction action = GraphObject.Factory.create(OpenGraphAction.class);
            action.setProperty("object", "http://object.url");

FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(this, action, "appnamespace.action", "object")
                    .build();
uiHelper.trackPendingDialogCall(shareDialog.present());

解决方案

After hours and hours of trial and error, I've finally figured this out. Wish it was much simpler though. Facebook should provide a code generator.

Anyways, the solution for my problem is that the action word has to match the one that facebook set perfectly. The only way to see this is at the open graph code generator for types.

https://developers.facebook.com/apps/{app-id}/opengraph/types

You can find it at the above link at the action types section.

Now, take the namespace and action type that facebook provided and replace it with "appnamespace:action" below.

OpenGraphAction action = GraphObject.Factory.create(OpenGraphAction.class);
        action.setProperty("object", "http://object.url");

FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(this, action, "appnamespace.action", "object")
                .build();
uiHelper.trackPendingDialogCall(shareDialog.present());

这篇关于分享对话​​框返回异常,并与QUOT;未能生成用户的Facebook和QUOT preVIEW;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆