gpt4 book ai didi

javascript - 使用 JavaScript sdk() 显示错误的 Facebook 自定义故事分享(操作需要至少一个引用)

转载 作者:数据小太阳 更新时间:2023-10-29 05:19:00 26 4
gpt4 key购买 nike

我正在为我的一个 Facebook Canvas 游戏应用程序使用 JavaScript SDK。我正在尝试实现自定义故事共享对话框以在用户墙上发布故事。

开发者网站上可用的信息不清楚且有限。下面的代码用于使用 open grap API 共享自定义故事。提供的 Facebook 开发者站点链接 (https://developers.facebook.com/docs/sharing/reference/share-dialog) 上提供了以下代码。 Facebook 提供的代码运行良好,因为它使用预定义的 action_type。

FB.ui({
method: 'share_open_graph',
action_type: 'og.likes',
action_properties: JSON.stringify({
object:'https://developers.facebook.com/docs/',
})
}, function(response){});

我已经在 FB Developer 控制台 App 的 Open Graph 选项卡上为自定义故事创建了一个对象(板球)和 Action (播放)。我已经创建了一个名为 cricket.html 的自托管对象(html 页面)。Bellow 是内容或我的html 页面。我验证了 Open Graph Object Debugger 上的 html 页面。Graph Object Debugger 向我显示了所有信息,我提供的信息没有错误或警告。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta property="fb:app_id" content="*************" />
<meta property="og:type" content="appnamespace:cricket" />
<meta property="og:title" content="App for u" />
<meta property="og:url" content="https://example.com/appnamespace/cricket.html" />
<meta property="og:description" content="Find me on facebook for u" />
<meta property="og:image" content="https://example.com/appnamespace/image/any_time_share.png" />

</head>
<body>
</body>
</html>

波纹管是我要替换的代码:-og.likes ---to--->appnamespace:play(“play”是我的 Action ).

我在这里做错了什么吗?请告诉我。

function customshare()
{
FB.ui({
method: 'share_open_graph',
action_type: 'appnamespace:play',
action_properties: JSON.stringify(
{
object:'https://example.com/appnamespace/cricket.html',
})
},
function(response){});
}

但是,我在执行 FB.ui 方法时遇到以下错误:自定义共享的“share_open_graph”。

enter image description here

最佳答案

我通过简单的改变解决了我的问题:-

object:'https://example.com/appnamespace/cricket.html',

cricket:'https://example.com/appnamespace/cricket.html',

关于javascript - 使用 JavaScript sdk() 显示错误的 Facebook 自定义故事分享(操作需要至少一个引用),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23966283/

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