Facebook 图形 API Stream.publish 中的问题
我正在使用 Graph API 并使用stream.publish,它以前工作正常,但现在当我在 js 文件中分离 JS 时,我将 CANVAS URL 作为参数传递给 javascript 函数,以下是我的代码:
function feedPublish(message,image,canvasURL){
var attachment = {'media':[{'type':'image','src':image,'href':canvasURL}]};
var action_links= [{ 'text':"Music Mood", 'href': canvasURL }];
message="I am in mood of "+message;
FB.ui({'method':'stream.publish','message':message,
'attachment':attachment,
'action_links':action_links
},
function(response){
}
);
}
function publishMessage(message,canvasURL){
var emo_id='id_'+$('emoction').val();
var emo_image=$('#'+emo_id+' img.emoction_image').attr('src');
feedPublish(message,emo_image,canvasURL);
}
然后从我调用的 html函数在单击此处发布消息:
publishMessage('Gimme More (The Legendary Ms. Britney Spears)','http://apps.facebook.com/musicmood'); return false;
并在屏幕截图中出现以下错误:
所以我无法了解问题,知道问题是什么或者我该如何解决它?
I am using Graph API and using stream.publish, it was previously working fine but now when I separate JS in a js file then I am passing CANVAS URL as an argument to javascript function, following is my code:
function feedPublish(message,image,canvasURL){
var attachment = {'media':[{'type':'image','src':image,'href':canvasURL}]};
var action_links= [{ 'text':"Music Mood", 'href': canvasURL }];
message="I am in mood of "+message;
FB.ui({'method':'stream.publish','message':message,
'attachment':attachment,
'action_links':action_links
},
function(response){
}
);
}
function publishMessage(message,canvasURL){
var emo_id='id_'+$('emoction').val();
var emo_image=$('#'+emo_id+' img.emoction_image').attr('src');
feedPublish(message,emo_image,canvasURL);
}
then from html I am calling function publish Message on click here:
publishMessage('Gimme More (The Legendary Ms. Britney Spears)','http://apps.facebook.com/musicmood'); return false;
And getting the following error that is in screenshot:
So I am unable to understand problem, any idea that what's the problem or how can I fix that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在使用旧方法发布“stream.publish”,请使用图形 API 中包含的“feed”方法
有关更多详细信息,请访问此 http://developers.facebook.com/docs/reference /javascript/fb.ui/
You are using old method for publishing "stream.publish" please use "feed" method which is included in Graph API
For more details visit this http://developers.facebook.com/docs/reference/javascript/fb.ui/
Facebook 说:
我建议您使用图形 api 并使用相同的参数向
/me/feed
发送 POST 请求 它会起作用的。Facebook says:
I would advice you to use the graph api and send a POST request to
/me/feed
with same parameters. It will work.