Javascript API共享函数给出错误
阿格!我在尝试从facebook上的Tab应用程序发布到用户提要时遇到了一个问题 我使用FB.ui以以下方式发布到流:Javascript API共享函数给出错误,javascript,facebook,fbjs,Javascript,Facebook,Fbjs,阿格!我在尝试从facebook上的Tab应用程序发布到用户提要时遇到了一个问题 我使用FB.ui以以下方式发布到流: window.fbAsyncInit = function() { FB.init({ appId : '<?php echo FACEBOOK_APPLICATION_ID ?>', status : true, // check login status cookie : tr
window.fbAsyncInit = function() {
FB.init({
appId : '<?php echo FACEBOOK_APPLICATION_ID ?>',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
/*channelUrl : 'http://www.yourdomain.com/channel.html', // Custom Channel URL*/
oauth : true //enables OAuth 2.0
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
function shareOnFacebook(){
FB.ui({
method: 'feed',
name: 'Example',
link: 'http://example.com',
picture: 'http://example.com/share.jpg',
caption: '',
description: '<?php echo urlencode($shareMessage); ?>'
});
}
我经常收到这个信息
出现错误,请重试
当用户通过PHPSDK授权应用程序时,我正在请求“发布流”权限。。。并且在其他应用程序中使用了这个精确的代码
有人能告诉我解决这个问题的方法吗?非常感谢您的任何帮助
干杯 对于FB.ui,您不需要任何权限,因为它是交互式的,可以随意使用,与服务器端无关,您是否有我们可以查看的测试页面
FB.init({appId: "YOUR_APP_ID", status: true, cookie: true});
function postToFeed() {
// calling the API ...
var obj = {
method: 'feed',
redirect_uri: 'YOUR URL HERE',
link: 'https://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
name: 'Facebook Dialogs',
caption: 'Reference Documentation',
description: 'Using Dialogs to interact with people.'
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
请确保正确打印appid,在我看来这确实像是一个应用程序问题