Stream.publish 问题,共享不起作用
两天前,我开始开发一个新的应用程序,我只是复制并粘贴我的另一个应用程序,然后按照我想要的方式更改它。
**问题是我的旧应用程序与共享功能完美配合,但新应用程序出现错误:
发生错误。请稍后重试。
我没有忘记在FB.init中更改APP_ID。
我的分享功能:
<script type="text/javascript">
function fb_share()
{
var publish = {
method: 'stream.publish',
message: 'Apie tai, kuo gyvena kauniečiai :)',
attachment: {
name: 'Kas vyksta Kaune tiesioginės transliacijos',
caption: '',
description: (
'Kas vyksta Kaune vaizdas gyvai visiems kauniečiams!'
),
media: [
{
type: 'image',
href: 'http://www.facebook.com/Kaunas.gyvai?sk=app_292352984114290',
src: 'http://misterp.lt/apps/share/Bambuser_app_icon.jpg'
}
]
,href: 'http://www.facebook.com/Kaunas.gyvai?sk=app_292352984114290'
},
action_links: [
{ text: 'Tinklapis', href: 'http://www.facebook.com/Kaunas.gyvai?sk=app_292352984114290' }
],
user_message_prompt: 'Kas vyksta Kaune tiesioginės transliacijos'
};
FB.ui(publish, function(response) { console.log(response); });
}
</script>
Two days ago I started to develop a new application, and I am just copied and pasted my other application, and then change it like how I want.
**The problem is that my old application worked perfectly with the share function, but the new one gives an error:
An error occurred. Please try again later.
I didn't forget to change APP_ID in FB.init.
My share function:
<script type="text/javascript">
function fb_share()
{
var publish = {
method: 'stream.publish',
message: 'Apie tai, kuo gyvena kauniečiai :)',
attachment: {
name: 'Kas vyksta Kaune tiesioginės transliacijos',
caption: '',
description: (
'Kas vyksta Kaune vaizdas gyvai visiems kauniečiams!'
),
media: [
{
type: 'image',
href: 'http://www.facebook.com/Kaunas.gyvai?sk=app_292352984114290',
src: 'http://misterp.lt/apps/share/Bambuser_app_icon.jpg'
}
]
,href: 'http://www.facebook.com/Kaunas.gyvai?sk=app_292352984114290'
},
action_links: [
{ text: 'Tinklapis', href: 'http://www.facebook.com/Kaunas.gyvai?sk=app_292352984114290' }
],
user_message_prompt: 'Kas vyksta Kaune tiesioginės transliacijos'
};
FB.ui(publish, function(response) { console.log(response); });
}
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了答案。问题是我在我的应用程序中包含了“Facebook live Stream”插件,同时使用 fbAsyncInit 来调整 iframe 的大小。
我刚刚从 fb-live-stream 插件和分享功能中删除了
js.src = "//connect.facebook.net/en_US/all.js#appId=292352984114290&xfbml=1";
开始工作了。I found an answer. The problem was that I included the "Facebook live stream" plugin in my application and at the same time used fbAsyncInit to resize the iframe.
I just deleted
js.src = "//connect.facebook.net/en_US/all.js#appId=292352984114290&xfbml=1";
from the fb-live-stream plugin and the share function started to work.